I can't find the answer to this in any C reference. The question is, is there any way to do this:
#define MAX 10;
struct aStruct {
int a;
int b;
};
typedef struct aStruct aType;
aType array_of_atype[] = {
{1, 2},
{3, 4},
{5, 6},
{7, 8},
{9, 10}
};
int main(int argc, char *argv[]) {
aType *pointer_to_array_of_atype[MAX];
pointer_to_array_of_atype = &array_of_atype;
return 0;
}
I'm trying to have a type that I can declare a array of, then have a pointer to an array of that type. However I get error: incompatible types in assignment
on the line pointer_to_array_of_atype = &array_of_atype;
. Any ideas? I'm using GCC/MinGW32. Thanks for looking.