Im trying to find a way to limit my input type to just only one in the game Hangman without using the LetterFill. The hangman works perfectly and when you input more than 1 character (ex. ABC) it will accept it and input and 1 by 1 but my prof said that it should only input only 1 character and if there are more than 1 it will eliminate/ignore the other letters any idea how to do it?
Code:
char x;
cin >> x;
if (guesses.find(x) == string::npos)
guesses += x;