The function declaration is wrong.
As the parameter has the type char * then the expressions array[i] yields a scalar object of the type char that is promoted to the type int due to the integer promotions to which you may not apply the subscript operator as you are trying to do array[i][j]. So the compiler issues the error message
E0142: "expression must have pointer-to-object type but it has type
int"
The function should be declared like
void disp_array(char array[][SIZE], int n )
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < SIZE; j++)
{
printf("%c", array[i][j]);
}
printf("\n");
}
}
or like
void disp_array(char (*array)[SIZE], int n )
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < SIZE; j++)
{
printf("%c", array[i][j]);
}
printf("\n");
}
}
The parameter having the array type char[SIZE][SIZE] is implicitly adjusted by the compiler to the type char ( * )[SIZE]. That is the function does not know how many elements of the type char ( * )[SIZE] exist. So you need to specify the number of elements explicitly. Try always to define a more general function.
And along with the array you need to pass the number of rows in the array. For example
disp_array( array, SIZE );
If the array contains strings then the function definition will look like
void disp_array(char (*array)[SIZE], int n )
{
for (int i = 0; i < n; i++)
{
puts( array[i] );
}
}