basic_ios::rdstate

Liest den Zustand von Bits für Flags.

iostate rdstate( ) const;

Rückgabewert

Die gespeicherten Streamzustandsinformationen.

Beispiel

// basic_ios_rdstate.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>
using namespace std;

void TestFlags( ios& x ) 
{
   cout << ( x.rdstate( ) & ios::badbit ) << endl;
   cout << ( x.rdstate( ) & ios::failbit ) << endl;
   cout << ( x.rdstate( ) & ios::eofbit ) << endl;
   cout << endl;
}

int main( ) 
{
   fstream x( "c:\test.txt", ios::out );
   x.clear( );
   TestFlags( x );
   x.clear( ios::badbit | ios::failbit | ios::eofbit );
   TestFlags( x );
}
  

Anforderungen

Header: <ios>

Namespace: std

Siehe auch

Referenz

basic_ios Class

Programmierung der iostream-Headerdatei

iostreams Konventionen