I have to sat I don't understand your question... You already have a do-while so you exit from the cycle when RGuess is equal to RNum. Why do you want to use break? Can you explain your problem a little bit better?
Basically I want to add a key press function , quitting the program when 'a' is pressed. So the user can either make a guess or quite the game without guessing by pressing 'a'.
May I ask why you're mixing C++'s "cin >>" with C's scanf() function? Also, if you do want to see a way in C++ of being able to ask for both a character and a number at the same time, I can show one using std::stringstream.
koothkeeper, I don't think your function would work since you're trying to compare a c-string literal to an int.
@Ganado, you're right! I haven't used scanf() in 25 years. I forgot that if the input doesn't match one of the formatting characters, scanf can return an error. In this case, since we're using '%d', putting a 'q' in causes scanf() return zero, and scanf() becomes unusable, at least on my system.
You're right about mixing C++ and C: 'tain't neat! This is much easier with the functions and libraries offered to us with C++.