showpos

Veranlasst positive Zahlen, explizit signiert werden.

ios_base& showpos(
   ios_base& _Str
);

Parameter

  • _Str
    Ein Verweis auf ein Objekt des Typs ios_base oder zu einem Typ, der von ios_base erbt.

Rückgabewert

Ein Verweis auf das Objekt, von dem _Str abgeleitet wird.

Hinweise

noshowpos ist die Standardeinstellung.

Der Manipulator ruft effektiv _Str.setf(ios_base::showpos) an und gibt dann _Str zurück.

Beispiel

// ios_showpos.cpp
// compile with: /EHsc
#include <iostream>

int main( ) 
{
   using namespace std;
   int i = 1;

   cout << noshowpos << i << endl;   // noshowpos is default
   cout << showpos << i << endl;
}
  

Anforderungen

Header: <ios>

Namespace: std

Siehe auch

Referenz

Programmierung der iostream-Headerdatei

iostreams Konventionen