I get the error message: dereferencing pointer to incomplete type
for every line where i use the code line: pointer->variableinstructure
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct OUTPUT_DATA
{
int C_num;
int P_num;
int B_num;
float Prix_C;
float Prix_B;
float Prix_P;
};
void Output_Data(struct OUTPUT_DATA *);
int main()
{
//All my variables are declared, i double checked....
struct OUTPUT_DATA NUM_COST;
NUM_COST.C_num = ((sortieHeureMaxPanneaux / eff_conv) / 5) + 1;
NUM_COST.B_num = ((Besoin / eff_conv) / 4.8) + 1;
NUM_COST.P_num = Aire + 1;
NUM_COST.Prix_C = NUM_COST.C_num * C$;
NUM_COST.Prix_B = NUM_COST.B_num * B$;
NUM_COST.Prix_P = NUM_COST.P_num * P$;
Output_Data(NUM_COST);
system("PAUSE");
return 0;
}
void Output_Data(struct OUTPUT_DATA *NUM_COSTptr)
{
char article[3][29] = {"Batteries (4.8 V)","Convertisseurs (5 KW)","Panneaux photovoltaique (m^2)"};
float $Total;
printf("\nAfin d’installer un bloc d’alimentation électrique photovoltaïque à panneaux plats pour l’utilisation résidentielle à Ottawa, ON, vous aurez besoin de:\n\n");
printf("%d %s = %f", NUM_COSTptr->B_num, article[0], NUM_COSTptr->Prix_B);
printf("\n%d %s = %f", NUM_COSTptr->C_num, article[1], NUM_COSTptr->Prix_C);
printf("\n%d %s = %f", NUM_COSTptr->P_num, article[2], NUM_COSTptr->Prix_P);
$Total = NUM_COSTptr->Prix_B + NUM_COSTptr->Prix_C + NUM_COSTptr->Prix_P;
printf("\n\nCouts total: %f", $Total);
}