std::basic_istream::unget
Da cppreference.com.
< cpp | io | basic istream
![]() | 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. |
basic_istream& unget(); | ||
Rende il personaggio più recente estratto nuovamente disponibile.
Original:
Makes the most recently extracted character available again.
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.
In primo luogo cancella eofbit, quindi si comporta come
UnformattedInputFunction
. Dopo la costruzione e la verifica dell'oggetto sentinella, chiama rdbuf()->sungetc().Original:
First clears eofbit, then behaves as
UnformattedInputFunction
. After constructing and checking the sentry object, calls rdbuf()->sungetc().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.
Se rdbuf()->sungetc() restituisce Traits::eof(), chiama setstate(badbit).
Original:
If rdbuf()->sungetc() returns Traits::eof(), calls setstate(badbit).
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.
In ogni caso, imposta il contatore a zero
gcount()
.Original:
In any case, sets the
gcount()
counter to zero.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
(Nessuno)
Original:
(none)
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]Valore di ritorno
*this
[modifica]Esempio
#include <sstream>#include <iostream>int main(){std::istringstream s1("Hello, world.");char c1 = s1.get();if(s1.unget()){char c2 = s1.get();std::cout<<"Got: "<< c1 <<" got again: "<< c2 <<'\n';}}
Output:
Got: H got again: H
[modifica]Vedi anche
estratti di caratteri Original: extracts characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
legge il carattere successivo senza estrarlo Original: reads the next character without extracting it The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
mette carattere nel flusso di input Original: puts character into input stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |