void square_function(int original[][COLUMNS]);
>Would this be the replacement to return the pointer?
Code:
void square_function( int original[][COLUMNS] )
{
int i, j;
for (i=0 ; i < ROWS ; i++)
for (j=0 ; j < COLUMNS ; j++)
original[i][j] *= 2;
}
>To call this function in the code is this the correct format:
Code:
const int ROWS = 5;
const int COLUMNS = 5;
int main(void)
{
int r,c;
for (r=0; r<ROWS; r++)
for (c=0; c<COLUMNS; c++)
original[r][c] = 2;
square_function(original);
for (r=0; r<ROWS; r++)
for (c=0; c<COLUMNS; c++)
printf("original[%d][%d]=%d\n",r,c,original[r][c]);
return 0;
}