|
|
#include <iostream.h>int rdstate() const;
The rdstate( ) function is a member of ios.
The rdstate( ) function returns the status of the associated stream. The C++ I/O system maintains status information about the outcome of each I/O operation relative to each active stream. The current state of the I/O system is held in an integer, in which the following flags are encoded:
Name | Meaning |
---|---|
ios::goodbit | No errors occurred. |
ios::eofbit | End of file is encountered. |
ios::failbit | A nonfatal I/O error has occurred. |
ios::badbit | A fatal I/O error has occurred. |
These flags are enumerated inside ios.
rdstate( ) returns zero (ios::goodbit) when no error has occurred; otherwise, an error bit has been set.
Related functions are eof( ), good( ), bad( ), clear( ), and fail( ).
|
|