std::setiosflags
Aus cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <iomanip>
|
||
/*unspecified*/ setiosflags( std::ios_base::fmt_flags mask ); |
||
When used in an expression out << setiosflags(mask) or in >> setiosflags(mask), sets all format flags of the stream out
or in
as specified by the mask
.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
mask | - | bitmask of the flags to set |
[Bearbeiten] Rückgabewert
Gibt ein Objekt vom angegebenen Typ, so dass, wenn
str
der Name eines Output-Stream vom Typ ist std::basic_ostream<CharT, Traits> oder std::basic_istream<CharT, Traits>, dann ist der Ausdruck str << setiosflags(mask) oder str >> setiosflags(mask) verhält, als ob der folgende Code ausgeführt wurde:Original:
Returns an object of unspecified type such that if
str
is the name of an output stream of type std::basic_ostream<CharT, Traits> or std::basic_istream<CharT, Traits>, then the expression str << setiosflags(mask) or str >> setiosflags(mask) behaves as if the following code was executed:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
str.setf(mask);
[Bearbeiten] Beispiel
#include <iostream> #include <iomanip> int main() { std::cout << std::resetiosflags(std::ios_base::dec) << std::setiosflags( std::ios_base::hex | std::ios_base::uppercase | std::ios_base::showbase) << 42 << '\n'; }
Output:
0X2A
[Bearbeiten] Siehe auch
setzt bestimmten Format Flagge Original: sets specific format flag The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion of std::ios_base )
| |
löscht die angegebene ios_base Fahnen Original: clears the specified ios_base flags The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Funktion) |