I/O Status Handling In C++
Associated with each stream is a set of flags indicating the I/O state of the stream. For example, the flag ios::eofbit indicates that no more characters can be extracted from a stream, and the flag ios::failbit indicates that some previous request failed. The I/O state flags can be tested by member functions; for …