我有以下程序,它给了我一个Segmentation fault (core dumped)
在线*(x[0][0])=(int )&c[1][1];
int main() {
int (*ovi)[3]= malloc(5*(sizeof *ovi));
int (**x)[3]= malloc(5*(sizeof x));
int *** c = malloc(4*(sizeof*c));
*(c+0)=(int **)&(*(ovi+1));
*(c+1)=(int **)&(*(ovi+2));
*(*(ovi+0)+0)=0;
*(*(ovi+0)+1)=1;
*(*(ovi+1)+0)=10;
*(*(ovi+1)+1)=11;
*(*(ovi+2)+0)=20;
*(*(ovi+2)+1)=21;
int *y[3][5] ;
y[0][0]=(int *)&c[1][1];
printf("%i\n",*(y[0][0]));
*(x[0][0])=(int )&c[1][1];
printf("%i\n",(*(x[0][0]))); //output should be 21
free(ovi);
free(c);
return(0);
}