Is it possible to make a function that works with arrays of undefined length?
For example, I made this code to fill a matrix of 3x3 and I wonder if is there a way to do this but with a matrix of nxn.
void fillMatrix(double mat[][COLS])
{
int i,j;
printf("Enter the %d matrix elements:\n",COLS*ROWS);
for(i=0;i<ROWS;i++)
{
for(j=0;j<COLS;j++)
{
scanf("%lf",&mat[i][j]);
}
}
printf("\n");
}
In this code I defined ROWS=COLS=3.