You tried to print an out of bounds array index and that's why it's a random character. Also some of your syntax is wrong. "and" should be "&&", "==" is comparing "=" is assign a new value. Also using recursive like this is a waste of system resources. Instead try this:
#include <iostream>
void PrintEntireArray(char array[4][4],int MaxColumn,int MaxRow)
{
for(int r = 0; r < MaxRow; r++){ //This iterate through the rows
for(int c = 0; c < MaxColumn; c++){ //Haha C++, also this iterate through the columns
std::cout << array[r][c] << "\t";
}
std::cout << "\n";
}
}
int main()
{
char hitmapp2[4][4] = {
{'1', '2', '3', '4'},
{'5', '6', '7', '8'},
{'9', 'a', 'b', 'c'},
{'d', 'e', 'f', 'g'}
};
PrintEntireArray(hitmapp2,4,4);
return 0;
}
Output:
1 2 3 4
5 6 7 8
9 a b c
d e f g