Here I will show how to use some the ifstream, and iostream functions.

Code Output
code code

No Output

Bit test (ios::) Description
eofbit This is set when the end of a input stream has been reached.
failbit Set when an operation on a bit has failed.
hardfail This is set when a fatal, unrecoverable error has occurred.
badbit This is set when an invalid operation has been attempted.
goodbit This is set when a attempted operation is successful.
Function Description
eof() Returns true if the End Of File is found.
fail() Returns true if a failbit or hardfail is found, and is set.
bad() Returns true if a bad bit is found, and badbit is set.
good() Returns true if the bit is good, and goodbit is set.
clear() Clears all flags from stream.