Int Validation

When utilising ifstream how to I check if the right integer was input?
(ie. the input has to be an int but there are letters instead) Then I would skip over that incorrect input, and continue reading the document.

I've seen a lot of questions when using cin, but not when reading from a file.
For user input:
http://www.LB-Stuff.com/user-input

For files, you should just abort and tell the user the file has a problem. It's a bad idea to try and carry on parsing a broken file.
gets
Topic archived. No new replies allowed.