#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//说实话,这个不理解,int(*p)[4]; 意思是定义一个数组指针!
void print(int(*p)[4], int row){
int i, j;
printf("sizeof(*p)=%d\n", sizeof(*p));
for (i = 0; i < row; i++) {//row=3 行
for (j = 0;j<sizeof(*p)/sizeof(int);j++){
printf("%3d", p[i][j]);
}
printf("\n");
}
}
int main() {
int a[][4] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
int(*p)[4];//定义一个数组指针!!!!!
int b[4] = { 1,2,3,4 };
char *pStr = (char*)malloc(5);
p = a;
print(a,3);//row=3
p = (int*)malloc(16 * 100);//二维数组的空间
p[99][3] = 1000;
strcpy(pStr, "helloworld");
puts(pStr);
free(pStr);
return 0;
}