二维数组指针
#include "stdio.h"
main()
{
int a[3][4]={1,3,5,7,9,11,13,15,17,19,21,23};
int (*p)[4]=a,i,j,k=0;
for (i=0;i<3;i++)
for (j=0;j<2;j++)
k=k+*(*(p+i)+j);
printf("%d\n",k);
}
p=0,i=j=0,k=3.
p=0,i=0,j=1,k=3+5=8.
p=0,i=1,j=0,k=8+7=15.
p=0,i=j=1,k=15+9=24.
p=0,i=2,j=0,k=24+11=35.
p=0,i=2,j=1,k=35+13=48.
我错哪了?结果是60.