std::boolalpha, std::noboolalpha
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 <ios>
|
||
std::ios_base& boolalpha( std::ios_base& str ); |
(1) | |
std::ios_base& noboolalpha( std::ios_base& str ); |
(2) | |
consente la bandiera
2) boolalpha
nel str
flusso come se chiamando str.setf(std::ios_base::boolalpha)Original:
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.
disabilita la bandiera
boolalpha
nel str
flusso come se chiamando str.unsetf(std::ios_base::boolalpha)Original:
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.
std::boolalpha
è un manipolatore di I / O, in modo che può essere chiamato con espressioni quali out << std::boolalpha per qualsiasi out
di std::basic_ostream tipo o con un'espressione come in >> std::boolalpha per qualsiasi in
di tipo std::basic_istream.Original:
std::boolalpha
is an I/O manipulator, so it may be called with an expression such as out << std::boolalpha for any out
of type std::basic_ostream or with an expression such as in >> std::boolalpha for any in
of type std::basic_istream.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
str | - | riferimento al flusso di I / O
Original: reference to I/O stream 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
str
(riferimento al flusso dopo la manipolazione)Original:
str
(reference to the stream after manipulation)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.
[modifica] Esempio
#include <sstream> #include <locale> #include <iostream> int main() { // boolalpha output std::cout << std::boolalpha << "boolalpha true: " << true << '\n' << "boolalpha false: " << false << '\n'; std::cout << std::noboolalpha << "noboolalpha true: " << true << '\n' << "noboolalpha false: " << false << '\n'; // booalpha parse bool b1, b2; std::istringstream is("true false"); is >> std::boolalpha >> b1 >> b2; std::cout << '\"' << is.str() << "\" parsed as " << b1 << ' ' << b2 << '\n'; }
Output:
boolalpha true: true boolalpha false: false noboolalpha true: 1 noboolalpha false: 0 "true false" parsed as 1 0
[modifica] Vedi anche
Template:cpp/locale/numpunct/dsc do truenameTemplate:cpp/locale/numpunct/dsc do falsename 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) | |
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) |