When doing a cin >> operation with a char variable like this.
1 2 3 4
char controlChar;
cout << "Would you like to make another choice?";
cout << "Enter 'y', or 'n' : ";
cin >> controlChar;
If the user enters more than one character it causes problems. If you use a loop to help control the input error you get something like this.
Would you like to make another choice?
Enter 'y', or 'n' : sd
Enter 'y', or 'n' :
Enter 'y', or 'n' :_
What can be done to separate the input? Would a get function work to only get the first character of the input? Can you cin.ignore(); everything but the first character?
I've used this before, I guess I was thinking that I needed to get (in the original post) the "s" and reject the rest of the stream. But if the "char" only stores the first character entered, then I don't need to worry about that, I was also thinking that if I used the cin.ignore(); it would ignore everything, including the character that already entered.