This documentation is archived and is not being maintained.

basic_ios::bad 

Indicates the state of rdstate & badbit.


bool bad( ) const;

1 or true if rdstate & badbit is nonzero; otherwise 0.

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

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

   b = cout.good( );
   cout << b << endl;
}

0
1

Header: <ios>

Show: