以下是引用wp231957在2012-11-25 07:57:54的发言:
#include <stdio.h>
int main(int argc,char*argv[])
{
char test[2][3]={'a','b','c','1','2','\0'};
int size1,size2,size3;
size1=sizeof test;
size2=sizeof test[0][0];
size3=sizeof &test[0][0];
printf( "test=%s,sizeof test=%d\n",test,size1);
printf( "test[0][0]=%c,sizeof test[0][0]=%d\n",test[0][0],size2);
printf( "&test[0][0]=%s,sizeof &test[0][0]=%d\n",&test[0][0],size3);
return 0;
}测试结果如下:
test=abc12 ,sizeof test=6
test[0][0]=a ,sizeof test[0][0]=1
&test[0][0]=abc12,sizeof &test[0][0]=4
char test[2][3]={'a','b','c','1','2','\0'}
这好像不是二维数组吧!