Поделиться через


basic_ios::bad

Indicates a loss of integrity of the stream buffer

bool bad( ) const;

Return Value

true if rdstate & badbit is nonzero; otherwise false.

For more information on badbit, see ios_base::iostate.

Example

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

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

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

Output

false
true

Requirements

Header: <ios>

Namespace: std

See Also

Reference

basic_ios Class

iostream Programming

iostreams Conventions

Other Resources

basic_ios Members