循环部分看不懂,高手给个详细说明。
#include <stdio.h>void main()
{
int a[3][4]={1,3,5,7,9,11,13,15,17,19,21,23};
int *p;
for(p=a[0];p<a[0]+12;p++)
{
if((p-a[0])%4= =0)
printf("\n");
printf("%4d",*p);
}
}
#include <stdio.h> int main(void) { int a[3][4] = {{1, 3, 5, 7}, {9, 11, 13, 15}, {17, 19, 21, 23}}; int i, *p = (int *)a; for(i = 0; i < 12; i++) { printf("%4d", *(p + i)); if(0 == (i + 1) % 4) { printf("\n"); } } return 0; }