Condividi tramite


basic_ios::fail

Indicates the status of rdstate & failbit.

bool fail( ) const;

Return Value

1 or true if rdstate & failbit is nonzero, otherwise 0 or false.

Remarks

boolalpha specifies the format of a bool variable.

Example

// basic_ios_fail.cpp
// compile with: /EHsc
#include <iostream>

int main( void ) 
{
   using namespace std;
   bool b = cout.fail( );
   cout << b << endl;
}

Output

0

Requirements

Header: <ios>

Namespace: std

See Also

Concepts

basic_ios Class

basic_ios Members

iostream Programming

iostreams Conventions