Learning the particularities of the C ANSI language this weekend and quite a challenge.
In an exercise I've got a header file that has a few declarations of signature of functions.
This one caught my attention:
typedef struct image * Image;
I tried this on my .c file :
typedef struct {
char nbrMagique[10];
unsigned long imgLarg;
unsigned long imgHaut;
unsigned long imgSeuilMax;
unsigned long **imageMatrice;
} Image;
But keep on constantly having error while compiling:
imagePGM.c:22:3: erreur: conflicting types for ‘Image’
} Image;
So I guess since I can't redefine the struct in the .c file and I can't touch the header either.
And to respect the "typedef struct image * Image;" in the .h header file I've got to create a dynamic 2 dimension table and point the pointer *image to it?
Am I missing out something in my reflexion?
But what does the pointer * in the signature of the typdef mean in the one of the .h file?