#include <iostream>bool bad() const;
The bad( ) function is a member of ios.
The bad( ) function returns true if a fatal I/O error has occurred in the associated stream; otherwise, false is returned.
A related function is good( ).