I have below code :
int main()
{
int* abc[] ={
[3] = (&(int[3]){1,2,3}),
[2] = (&(int[2]){4,5})
};
printf("\n abc[3][1] = %d \n",abc[3][1]);
return 0;
}
I am trying to set up my array abc , so that specific indexes of the array point to a different array of integers.
Later, I would modify this to use macros so that array is initialized during pre-processing, hence such an approach.
Code works fine but I get a warning :
warning: initialization from incompatible pointer type
Is this because my array abc is declared to point to integer but it is actually pointing to array of integers?
How can I make this warning go away?