Before I start let me state that the program is in C (not C++).
I find myself unable to eliminate this error about undeclared identifier and it's driving me nut. I have declared a structure that I use to declare an array like this:
1 2 3 4 5
|
struct tab_sub
{
int nb;
ptr_sub ptr;
};
|
typedef struct tab_sub * ptr_tab_sub;
I then use said typedef to declare said array with a malloc like so :
pre_tab_sub table_sub = malloc(nb_sub * sizeof(*table_sub));
Where nb_sub is a "loose" variable that will be passed to the function to allocate enough memory for the array.
now having this new array of variable size I allocate each sub with its info like so:
sub1->info1
sub2->info2
etc.
The funny thing is that all that work just fine but then come the really odd part. Back in the main I declare a handle with the typedef of that array
ptr_tab_sub holder;
in hope to pass it the address of the first element of the newly declared array so I can manipulate data and such.
but apparently, ptr_tab_sub is not considered an identifier. Which I find really odd since in the header and the .c there doesn't seem to be any problem. (and no, everything is included correctly).