Hey guys, I have a very simple question. I am trying to execute a very simple code but I can't seem to figure out why it isn't printing anything. Here's my code:
void InitialGameBoard()
//////////////////////////////////////////////////////
// This will display the initial game board as well //
// That is, a board that is empty and ready for new //
// game play. //
//////////////////////////////////////////////////////
{
int i, j;
char Board[3][3];
i = 0;
j = 0;
for(i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
Board[i][j] = ' M ';
cout << Board[i][j] << endl;
}
cout << endl;
}
}
A char is a single character, so when you try putting ' M ' into Board[i][j], only the first part is entered, which is a blank space. Try using 'M', without the space on each side. Should work okay, that way.