I don't now if your compiler didn't give you a warrning or not but you had a semicolon after a if statement
- Code: Select all
if(chara == 'O');
also here is a problem with your if at the top
- Code: Select all
if(charSelect == 'X'||charSelect == 'x')
chara = 'X';
if(charSelect == 'O'||charSelect == 'o')
chara = 'O';
else
cout << "Invalid choice\n";
you need to make the second if a else if
- Code: Select all
else if(charSelect == 'O'||charSelect == 'o')
because if you choose X then the second if will be false and run the else statement
I did not get an error myself so try that first and see if that was your problem