basic_ios::bad
Indicates a loss of integrity of the stream buffer
bool bad( ) const;
반환 값
true if rdstate & badbit is nonzero; otherwise false.
badbit에 대한 자세한 내용은 ios_base::iostate을 참조하십시오.
예제
// 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
요구 사항
Header: <ios>
네임스페이스: std