Export (0) Print
Expand All

basic_ios::fail 

Indicates the status of rdstate & failbit.


bool fail( ) const;

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

boolalpha specifies the format of a bool variable.

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

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

Header: <ios>

Community Additions

ADD
Show:
© 2015 Microsoft