【发布时间】:2009-04-28 18:56:48
【问题描述】:
我有一些二维数组,例如:
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};
等等。
如何创建指向这些指针的数组?
我尝试了以下方法,但它们不起作用(警告:从不兼容的指针类型初始化):
int *shapes[]= {&shape1,&shape2};
int *shapes[]= {shape1,shape2};
int **shapes[]= {&shape1,shape2};
有什么帮助吗?
【问题讨论】: