I am using visual studio 2008. I am trying to write a loop that continues until a user presses the y or the n key. I can do it if the user types one or the other of these and presses enter, but I want the loop to exit once Y or N is pressed directly. What I am doing is a yes/no prompt like this.
ThanksCode:char keyin; do { // Listen for keyboard input. If Y or N is pressed, terminate loop. } while (keyin != toupper('y') && keyin != toupper('n');