#include <fstream> bool bad();
The bad() function returns true if a fatal error with the current stream has occurred, false otherwise.