#include <stdio.h>
int main(int argc, const char * argv[]) {
//定义一个二维数组
int arr[3][4]={{1,2,4,2},{6,3,8,9},{3,5,7,2}};
//定义一个数组指针
int (*p)[4]=arr;
//遍历数组指针的元素值
for (int i=0; i<3; i++) { for (int j=0; j<4; j++) { printf("%d\n",*(*(p+i)+j));//p=arr=&arr[0] *(p+i)=arr *(arr+j)
// printf("%d\n",*(arr+j)); } }
return 0; }
|