The State of the Stream
Are there tools we can use in C++ which allow us to check the current condition of the stream? Flags answer this question.
We'll cover the following...
Flags represent the state of the stream stream
. The methods for dealing with these flags need the header <iostream>
.
Flag | Query of the flag | Description |
---|---|---|
std::ios::goodbit |
stream.good() |
No bit set |
std::ios::eofbit |
stream.eof() |
end-of-file bit set |