escaping from a switch/loop
Posted on 2004-10-14
I've written a very simple switch inside a loop, it's basically :
cout << "\n\nYour answer is : ";
cin >> letter;
letter = toupper(letter);
switch ( letter )
case 'A': cout << "Incorrect.";
case 'B': cout << "Correct.";
} } while (letter);
It actually has a few more options, but I won't bore you with that . . The thing is, while this is going on, there's nothing the user can do to end the program.
How can I specify something for the user to type in that will let them escape this loop ?