Hi, I want to know what is wrong in this code for reading and printing an array, because it gives "the program stopped working" when I run it.
#include<stdio.h>
int main(void)
{
int arr[2][3];
readmat(arr,2,3);
printmat(arr,2,3);
}
int readmat(int **mat,int m,int n)
{
int i,j;
for(i=0;i<m;++i)
for(j=0;j<n;++j)
scanf("%d",&mat[i][j]);
}
int printmat(int **mat,int m,int n)
{
int i,j;
for(i=0;i<m;++i)
{
for(j=0;j<n;++j)
printf("%d\t",mat[i][j]);
puts("\n");
}
}