#include <stdio.h>
#include <stdlib.h>
int main()
{
int i,j;
int (*a)[3]=NULL;
for(i=0; i<4;i++)
{
for(j=0; j<3;j++)
{
scanf("%d", *(a+i)+j);
}
}
for(i=0; i<4;i++)
for(j=0; j<3;j++)
printf("%5d", a[i][j]);
printf("\n");
return 0;
}
I have a problem with my C code above, which is trying to print a multi-dimensional array on screen. When running this code, a message of segmentation fault is sent to me and I don't know how to fix that.