std::setiosflags
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'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
.
Indice |
[modifica]Parametri
mask | - | bitmask of the flags to set |
[modifica]Valore di ritorno
Restituisce un oggetto di tipo non specificato tale che se
str
è il nome di un flusso di output di tipo std::basic_ostream<CharT, Traits> o std::basic_istream<CharT, Traits>, allora l'espressione str << setiosflags(mask)str >> setiosflags(mask) o si comporta come se il codice riportato di seguito è stato eseguito: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);
[modifica]Esempio
#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
[modifica]Vedi anche
imposta flag specifico formato 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. (metodo pubblico) | |
cancella le bandiere ios_base specificati 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. (funzione) |