Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


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 << b << endl;

Header: <ios>

© 2015 Microsoft