Namespaces
Variants

std:: showpoint, std:: noshowpoint

From cppreference.net
< cpp ‎ | io ‎ | manip
Input/output manipulators
Floating-point formatting
showpoint noshowpoint
Integer formatting
Boolean formatting
Field width and fill control
Other formatting
Whitespace processing
Output flushing
Status flags manipulation
Time and money I/O
(C++11)
(C++11)
(C++11)
(C++11)
Quoted manipulator
(C++14)
Definiert im Header <ios>
std:: ios_base & showpoint ( std:: ios_base & str ) ;
(1)
std:: ios_base & noshowpoint ( std:: ios_base & str ) ;
(2)

Aktiviert oder deaktiviert die bedingungslose Einbeziehung des Dezimaltrennzeichens in der Gleitkomma-Ausgabe. Hat keine Auswirkung auf die Eingabe.

1) Aktiviert das showpoint -Flag im Stream str , als ob durch Aufruf von str. setf ( std:: ios_base :: showpoint ) .
2) Deaktiviert das showpoint -Flag im Stream str , als ob durch Aufruf von str. unsetf ( std:: ios_base :: showpoint ) .

Dies ist ein I/O-Manipulator. Er kann mit einem Ausdruck wie out << std :: showpoint für jedes out vom Typ std::basic_ostream oder mit einem Ausdruck wie in >> std :: showpoint für jedes in vom Typ std::basic_istream aufgerufen werden.

Das Zeichen, das als Dezimaltrennzeichen verwendet wird, wird durch die numpunct-Facette der Locale bestimmt, die zum Zeitpunkt der Ausgabe in den Stream eingebettet ist, wie beschrieben in std::num_put::put .

Inhaltsverzeichnis

Parameter

str - Referenz auf I/O-Stream

Rückgabewert

str (Referenz auf den Stream nach der Manipulation).

Beispiel

#include <iostream>
int main()
{
    std::cout << "1.0 with showpoint: " << std::showpoint << 1.0 << '\n'
              << "1.0 with noshowpoint: " << std::noshowpoint << 1.0 << '\n';
}

Ausgabe:

1.0 with showpoint: 1.00000
1.0 with noshowpoint: 1

Siehe auch

löscht die angegebenen ios_base-Flags
(Funktion)
setzt die angegebenen ios_base Flags
(Funktion)