ios fail() function in C++ with Examples
The fail() method of ios class in C++ is used to check if the stream is has raised any fail error. It means that this function will check if this stream has its failbit set.
bool fail() const;
Parameters: This method does not accept any parameter.
Return Value: This method returns true if the stream has failbit set, else false.
is stream fail: 0
is stream fail: 1