Following version of your program is working fine with gcc( if we ignore a few warnings that it through):
Code:
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
void show(int (*q)[4],int row, int col);
int main()
{
int a[3][4] = {1,2,3,4,
5,6,7,8,
0,9,1,6
};
show(a,3,4);
return(0);
}
void show(int (*q)[4],int row, int col)
{
int i,j;
int (*p)[4];
for(i=0;i<row;i++)
{
p = &q[i];
for(j=0;j<col;j++)
printf("%d",p[j]);
printf("\n");
}
printf("\n");
}
Folloing is the output that i get:
What do you get when you try to compile it?