The extraction operator >> returns the stream you extracted from, and streams can be implicitly converted to bool to check their status. You can, for example, write if(std::cin >> MyInt), and if you end up in the else clause you need to use clear() on cin and tell the user to try again. You can use a looping structure to repeatedly prompt the user until they enter valid numeric input.