int main(void)
{
int a[3][2] = {(0,1), (2,3), (4,5)};
int *p = a[0];
printf("*p = %d/n", p[0]);
return 0;
}
输出不是0而是1.数组初始化时花括号里面嵌套了小括号(逗号表达式),此初始化相当于a[3][2] = {1, 3, 5};
int main(void)
{
int a[3][2] = {(0,1), (2,3), (4,5)};
int *p = a[0];
printf("*p = %d/n", p[0]);
return 0;
}
输出不是0而是1.数组初始化时花括号里面嵌套了小括号(逗号表达式),此初始化相当于a[3][2] = {1, 3, 5};