Flags in ios class

Please explain me in what a flag is in ios class.

Generally flag is a variable which signels that some event happened (flag raised) or not.

std::ios_base specifies following iostate bitmasks which can be used to extract or set stream flags:
std::ios_base::eofbit : signals that stream encountered end of stream (file)
std::ios_base::failbit : signals that there were an error in preceding IO operations
std::ios_base::badbit : signals that internal integrity of stream is compromised.
std::ios_base::goodbit : signals that everything is all right and stream is ready for further operation

Also there are fmtflags which controls how stream process IO (base used for number processing, skip or not whitespaces....)
Topic archived. No new replies allowed.