std::resetiosflags
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*/ resetiosflags( std::ios_base::fmt_flags mask ); | ||
Quando viene utilizzato in un'espressione out << resetiosflags(mask) o in >> resetiosflags(mask), cancella tutte le bandiere di formato del flusso
out
in
o come specificato dal mask
.Original:
When used in an expression out << resetiosflags(mask) or in >> resetiosflags(mask), clears all format flags of the stream
out
or in
as specified by the mask
.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.
Indice |
[modifica]Parametri
mask | - | maschera di bit delle bandiere per cancellare Original: bitmask of the flags to clear The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[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 << resetiosflags(mask)str >> resetiosflags(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 << resetiosflags(mask) or str >> resetiosflags(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(std::ios_base::fmtflags(0), mask);
[modifica]Esempio
#include <sstream>#include <iostream>#include <iomanip>int main(){std::istringstream in("10 010 10 010 10 010");int n1, n2; in >>std::oct>> n1 >> n2;std::cout<<"Parsing \"10 010\" with std::oct gives: "<< n1 <<' '<< n2 <<'\n'; in >>std::dec>> n1 >> n2;std::cout<<"Parsing \"10 010\" with std::dec gives: "<< n1 <<' '<< n2 <<'\n'; in >> std::resetiosflags(std::ios_base::basefield)>> n1 >> n2;std::cout<<"Parsing \"10 010\" with autodetect gives: "<< n1 <<' '<< n2 <<'\n';}
Output:
Parsing "10 010" with std::oct gives: 8 8 Parsing "10 010" with std::dec gives: 10 10 Parsing "10 010" with autodetect gives: 10 8
[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) | |
imposta i flag ios_base specificati Original: sets 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) |