I'm creating a code for Tic Tac Toe, trying to use a void function for it to try again if the slot that they choose is full up. This is my code from boardInput() & tryAgain():
void boardInput()
{
int a;
cout << "Round: " << iRound << endl;
cout << "Row: ";
cin >> a;
int b;
cout << "Column: ";
cin >> b;
if (a == 1 && b == 1)
{
if (chGrid[0][0] == '-')
chGrid[0][0] = chPlayer;
else
{
tryAgain();
}
}
}
void tryAgain()
{
system("cls");
displayBoard();
cout << "ERROR! Try again!" << endl;
boardInput();
}
I've tried to move the void around and it still comes to the same error. Could anyone help me?