typedef struct Thm_t Thermal; struct Thm_t { int tableau[16]; // par exemple //autres variables };
int getThm(struct Thm_t* data);
data->tableau[5] = entier;
FILE* open = fopen("/proc/acpi/ibm/thermal", "r"); if (open == NULL) { fprintf(stderr, "error loading thermal file\n"); return 1; } Thermal* test_struct; test_struct = malloc(sizeof(Thermal)); getThm(open, test_struct); fclose(open);
gcc --std=c99 --pedantic -Wall -Wmissing-prototypes -g fancontrol.c main.c -o fancontrol main.c: In function ‘main’: main.c:26: error: invalid application of ‘sizeof’ to incomplete type ‘Thermal’ make: *** [fancontrol] Error 1