basic_ios::bad
Indicates a loss of integrity of the stream buffer
bool bad( ) const;
Valeur de retour
true if rdstate & badbit is nonzero; otherwise false.
Pour plus d'informations sur badbit, consultez ios_base::iostate.
Exemple
// 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;
}
Sortie
false
true
Configuration requise
Header: <ios>
Espace de noms : std