I am having trouble passing an 2d array to a function:
I am getting:Code:int sum (char ar[][], int i, int j){ // line 20
int x=0;
if (ar[i][j] == 'a')
x++;
if (ar[i][j] == 'b')
x+=2;
if (ar[i][j] == 'c')
x+=3;
return x;
}
...
for (i=0;i<10;i++)
for(j=0;j<10;j++)
int total= sum(ar,i,j); // line 40
printf("total is %d",total);
...
Quote:
-array type has incomplete element type (line 20)
-type of formal parameter 1 is incomplete (line 40)