Vlad was error testing the input and the other thing is error testing opening a file. You don't need limits to see if a file opens successfully or not.
What is this line exactly doing? I've seen the ignore part but the inside stuff is throwing me off. For the cin.fail() to work, do you have to have the ignore with all the stuff or is there an alternate way?
The function ignores all characters from the input buffer until it enocunteres the new line character. std::streamsize is a typedef for the integer type of the size of the input buffer. function max returns maximum value for this integer type.
You can put a large number where the limit is if its too hard to use or you don't want to use limits. As vlad already mentioned it is just the numeric limit for the stream which would mean you ignore everything in the stream you can also ignore a set amount of characters if you would like. cin.ignore( 1024 , '\n' ); I wouldn't recommend it though I would just use std::numeric_limits
Well it isn't a matter of which way is better, it's just that i haven't learned limits yet in my class so i dont know if the teacher would want us using them.