i have some bidimensional arrays like:
int shape1[3][5] = {1,0,0,
1,0,0,
1,0,0,
1,0,0,
1,0,0};
int shape2[3][5] = {0,0,0,
0,0,0,
0,1,1,
1,1,0,
0,1,0};
and so on.
How can i make an array of pointers to those?
I tried the following, but they don’t work (warning: initialization from incompatible pointer type):
int *shapes[]= {&shape1,&shape2};
int *shapes[]= {shape1,shape2};
int **shapes[]= {&shape1,shape2};
Any help?
Updated Fixed type. Thanks
j_radom_hackerfor bringing this to my attention![EDIT: Actually the type here was not correct — see Robert S. Barnes’ answer for the correct type to use.]
Figure out the type of
shape1andshape2first:Now use this: