Quick question - what compiler are you using, and what C++ version? And to your question of where you don't want the loop to stop, that's a harder problem. Because in order to do that, you need to have an If statement that checks if there's input from the keyboard. And if there isn't, don't pause the loop. There isn't anyway to check this in the base C++ library. You would be better off downloading another library that does this for you, such as SFML, or SDL and use their input function.