Two dimensional array as Function Parameter(Another Style)

Program

Program Source

#include <stdio.h>

void twodimension(int (*arr)[3],int row,int col)
{
    int i,j;
    for(i=0;i<row;i++)
    {
        for(j=0;j<col;j++)
        {
            printf("%d ",arr[i][j]);
        }
        printf("\n");
    }
}

int main()
{
    int number[3][3]={{10,20,30},{40,50,60},{70,80,90}};
    twodimension(number,3,3);
    return 0;
}

Leave a Comment