Dowemo
0 0 0 0

#include<stdio.h>
#include<stdlib.h>
void main()
{
 int num[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
 printf("%pn", num);
//线性的方式访问二维数组
//二维数组的地址也是连续的
 for (int *p = &num[0][0]; p <&num[0][0] + 12; p++)
 {
 printf("%d,%pn", *p, p);
 }
 printf("--------------------------------n");
 for (int i = 0; i <3; i++)
 {
 for (int j = 0; j <4; j++)
 {
//printf("%d,%pn", num[i][j], &num[i][j]);
 printf("%d,%pn", *(*(num + i) + j), *(num + i) + j);
 }
 }
 system("pause");
}




Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs