User Input Problem

My program asks the user to enter an int of some range. If the user inputs an alpha character, my program blows up. If the user enters an alpha char I would like to restate the question. Any thoughts on how I could do this?

1
2
3
4
int userInput;

cout << "Enter num between 1-10" << endl;
cin >> userInput;
This article explains how to solve your problem: http://www.cplusplus.com/forum/articles/6046/
Topic archived. No new replies allowed.