This is my program so far. It is meant to use a two-dimensional array to allow two people to play a game of tic tac toe. I use Visual Studio, and although it says it cannot detect any errors, it still will not run the program so far to print out what the game board will look like. It is supposed to print the unused spaces with "*" where the X's and O's will go.
Dutch is right: if the program just runs and exits then you just aren't seeing the output.
Also, you're printing the contents of the board entirely on one line. In addition, the horizontal lines at top and bottom don't match up with it. Here's a version that looks a little better:
1 2 3 4 5 6 7 8 9 10 11 12
char displayBoard(char board[3][3])
{
cout << "\nCurrently the board looks like this: " << endl;
cout << "-------------";
for (int i = 0; i < 3; i++) {
cout << "\n| ";
for (int j = 0; j < 3; j++) {
cout << board[i][j] << " | ";
}
}
cout << "\n-------------" << endl;
}