Freigeben über


ios_base::xalloc

Gibt an, dass eine Variable ein Teil eines Streams ist.

static int xalloc( );

Rückgabewert

Die statische Memberfunktion gibt einem gespeicherten statischen Wert zurück, den sie auf jedem Aufruf erhöht.

Hinweise

Sie können den Rückgabewert als Argument des eindeutigen Index verwenden, wenn Sie die Memberfunktionen iword oder pword aufrufen.

Beispiel

// ios_base_xalloc.cpp
// compile with: /EHsc
// Lets you store user-defined information.
// iword, jword, xalloc
#include <iostream>

int main( ) 
{
   using namespace std;
   
   static const int i = ios_base::xalloc();
   static const int j = ios_base::xalloc();
   cout.iword( i ) = 11;
   cin.iword( i ) = 13;
   cin.pword( j ) = "testing";
   cout << cout.iword( i ) << endl;
   cout << cin.iword( i ) << endl;
   cout << ( char * )cin.pword( j ) << endl;
}
  

Anforderungen

Header: <IOS>

Namespace: std

Siehe auch

Referenz

ios_base-Klasse

iostream-Programmierung

iostreams-Konventionen