Namespaces
Variants

std:: uppercase, std:: nouppercase

From cppreference.net
< cpp ‎ | io ‎ | manip
Input/output manipulators
Floating-point formatting
Integer formatting
Boolean formatting
Field width and fill control
Other formatting
uppercase nouppercase
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 in Header <ios>
std:: ios_base & uppercase ( std:: ios_base & str ) ;
(1)
std:: ios_base & nouppercase ( std:: ios_base & str ) ;
(2)

Ermöglicht die Verwendung von Großbuchstaben in der Ausgabe von Gleitkommazahlen und hexadezimalen Ganzzahlen. Hat keine Auswirkung auf die Eingabe.

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

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

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 << std::hex << std::showbase
              << "0x2a with uppercase: " << std::uppercase << 0x2a << '\n'
              << "0x2a with nouppercase: " << std::nouppercase << 0x2a << '\n'
              << "1e-10 with uppercase: " << std::uppercase << 1e-10 << '\n'
              << "1e-10 with nouppercase: " << std::nouppercase << 1e-10 << '\n';
}

Ausgabe:

0x2a with uppercase: 0X2A
0x2a with nouppercase: 0x2a
1e-10 with uppercase: 1E-10
1e-10 with nouppercase: 1e-10

Siehe auch

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