I'm making a tic-tac-toe game. everything works fine(this is a small portion of the program), but if a letter is entered then the program goes into an infinite loop. Something is wrong with the default case. I set x equal to false, so it should loop this portion of the code, but not infinitely. I've also tried replacing the "x = false" and "break;" with "return 0;". This terminates the program if a letter is the first thing you enter, but if you enter a letter after your first move then it goes into an infinite loop again. Could someone please explain why this is happening.
FYI: I have the do-while loop and if-else statements in there so that if the player tries to move in a spot where there is already an 'X' or 'O', then the program will loop this portion and ask them to move somewhere else.