basic_ios::fail
Indicates failure to extract a valid field from a stream.
bool fail( ) const;
Return Value
true if rdstate & (badbit|failbit) is nonzero, otherwise false.
For more information on failbit, see ios_base::iostate.
Example
// basic_ios_fail.cpp
// compile with: /EHsc
#include <iostream>
int main( void )
{
using namespace std;
bool b = cout.fail( );
cout << boolalpha;
cout << b << endl;
}
Output
false
Requirements
Header: <ios>
Namespace: std
See Also
Reference
Other Resources
Change History
Date |
History |
Reason |
---|---|---|
March 2009 |
Revised. |
Customer feedback. |