Freigeben über


basic_ios::bad

Indicates the state of rdstate& badbit.

bool bad( ) const;

Return Value

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

Example

// 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;
}

Output

0
1

Requirements

Header: <ios>

Namespace: std

See Also

Concepts

basic_ios Class

basic_ios Members

iostream Programming

iostreams Conventions