Hello,
I was having some trouble related to a code.
I wanted to pass a 2-D array as argument to a function,but I'm getting an error saying 'Expression Syntax in function Main'.
I am trying to do it like this :->
void input(int **a[][10],int b,int c)
{
int i,j;
printf("\nEnter the elements of the Array :-> ");
for (i=0;i<b;i++)
for (j=0;j<c;j++)
scanf("%d",&a[i][j]);
}
void main()
{
int a[10][10],b[10][10],c[10][10],i,j,k,choice,m,n;
printf("Enter the no. of rows and cols for A and B :-> ");
scanf("%d%d",&m,&n);
input(a[][10],m,n);
input(b[][10],m,n);
getch();
}
So,I wanted to know where am I wrong.
At some place I read that in C 2-D arrays can't be passed as arguments.
If so,how can I pass them??
Thanks In Advance
Chirag_Mittal