If no character in an input stream is found-including the end-of-file mark-that can belong to a value of the type of the variable, the input operation is said to fail. Because no characters are removed from the stream, an infinite loop can easily result. Including a statement such as
After the input statement can be used to detect this condition and terminate repetition. The ignore 0 function member can be used to remove offending characters from the stream.