Electrical and Computer Engineering
7 of 22
UAH
CPE 112
Testing the State of an
I/O Stream
•C++ provides a way to check whether a stream is in the fail state. You simply use the name of the stream object as if it were a Boolean variable.