我想在点人的帮助下扫描一个2D阵列,并撰写了这一法典,请告诉我,编辑者为什么会犯错误? I know How to use Double pointers to do same, i is conducted with this.
#include<stdio.h>
#include<stdlib.h>
int main(void) {
int i,j,n,a,b;
int (*(*p)[])[];
printf("
Enter the size of the matrix in the form aXb
");
scanf("%dX%d",&a,&b);
p=(int (*(*p)[b])[a])malloc(b*sizeof(int (*p)[a]));
for(i=0;i<b;i++) {
p[i]=(int (*p)[a])malloc(a*sizeof(int));
printf(" Enter Column %d
");
for(j=0;j<a;j++)
scanf("%d",&p[i][j]);
}
return 0;
}