Error output

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!
you can also see my topic if you want.
http://www.cplusplus.com/forum/beginner/17916/#msg91123
Topic archived. No new replies allowed.