void print( matrix)
{
printf(" 0 1 2 3 4 5 6 7 \n"); /* printing the game board */
printf(" ------------------------------------- \n");
for (int i = 0; i < 8; i++)
{
printf("%d|", i);
for (int j = 0; j < 8; j++)
{
printf(" %3c ", matrix[i][j]);
}
printf("\n");
}
}
so I defined this function in the compiler, ran the code and get the following error message for this line printf(" %3c ",matrix[i][j]);
subscripted value is neither array nor pointer nor vector
I tried defining the matrix
as int and as char value, but still same error
what I am trying to achieve by calling the function
one more thing is that the code itself without being a function works without a problem
calling the function: first I defined
char playboard[8][8];
then filled the array with the symbol "~"
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
playboard[i][j] = '~';
}
}
then called the function print
print(playboard);