
please wait
cin >> [integer/float and so on];
if there is no number in the stream, failbit will be set. A simple way to check it is if(cin >> [some integer])/*success!*/; else /*fail*/;
.cin.clear()
to reset fail flag, and cin.ignore(numeric_limits<streasize>::max(), '\n');
to clear the stream (note that for numeric_limits you'll have to include <limits>. Also, you could put any number there, but numeric_limits<streamsize>::max will definitely clear everything, while with smaller numbers may have to repeat this operation).