Error output

Jan 6, 2010 at 10:15am
I would like to ask how I could make this condition

int input;

cin >> input;

If (input is not an int type )
{cout << "error" << }

else { cout << "your input is an int type" << endl;}

This is supposed to be a part of a code I'm making that when the user types in an invalid input, there will be an error message then the computer will redo the loop statement.

Thanks for reading!
Jan 6, 2010 at 11:24am
Jan 7, 2010 at 7:50am
you can also see my topic if you want.
http://www.cplusplus.com/forum/beginner/17916/#msg91123
Topic archived. No new replies allowed.