How to use a two dimensional array in function declaration statement? : <pre><code>void sort(int [],int);
</code></pre>

<p>This is how I usually use a single dimensional array(i.e: <code>int []</code> ) inside a function declaration statement for programs like sorting and it works fine without any problem</p>

<p>But for my matrix addition program  when I use a two dimensional array(i.e:<code>int [][]</code> ) inside a function declaration statement with the similar format  <code>void mat(int [][],int [][],int ,int);
</code>Iam getting some error messages like:-</p>

<p>1.multidimensional array must have bounds for all dimensions except the first.</p>

<p>2.invalid conversion from 'int (*)[10]' to 'int' [-fpermissive].</p>

<p>So my question is how to write a two dimensional array inside a function declaration statement.</p>

<p>Below I have attached my full Matrix addition program using functions:-</p>

<pre><code>#include&lt;stdio.h&gt; 
void mat(int [][],int [][],int ,int);
int main()
{
    int a[10][10],b[10][10],m,n,i,j;
    printf("Enter the rows and coloumns: ");
    scanf("%d %d",&amp;m,&amp;n);
    printf("\nEnter the elements of 1st Matrix:");
    for(i=0;i&lt;m;i++)
        for(j=0;j&lt;n;j++)
        scanf("%d",&amp;a[i][j]);
    printf("\nEnter the elements of the 2nd Matrix:");
    for(i=0;i&lt;m;i++)
        for(j=0;j&lt;n;j++)
            scanf("%d",&amp;b[i][j]);
    mat(a,b,m,n);
}
void mat(int a[10][10],int b[10][10],int m,int n)
{
    int i,j,c[10][10];
    for(i=0;i&lt;m;i++)
        for(j=0;j&lt;n;j++)
        c[i][j]=a[i][j]+b[i][j];
        printf("\nThe addition of the 2 Matrix is :");
        for(i=0;i&lt;m;i++)
        {
            printf("\n");
            for(j=0;j&lt;n;j++)
            printf("%d",c[i][j]);
        }
}
</code></pre>
