1.

How is the working of file I/O error handling functions associated with error-status flags?

Answer»

The error-status flags store the information on the status of a file that is being currently used. The current state of the I/O system is held in an integer, in which the following flags are encoded:

NameMeaning
eofbit1 when end-of-file is encountered, 0 otherwise.
failbit1 when non-fatal I/O error has occurred, 0 otherwise. 
badbit1 when fatal I/O error has occurred, 0 otherwise.
goodbit0 value


Discussion

No Comment Found

Related InterviewSolutions