◐ Shell
clean mode source ↗

std::basic_istream::unget - cppreference.com

De cppreference.com

Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.

La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí.

Hace que el personaje más recientemente extraído disponible nuevamente .

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.

Primero despeja

eofbit

, entonces se comporta como UnformattedInputFunction. Después de la construcción y comprobación del objeto centinela, llama rdbuf()->sungetc() .

Original:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Si vuelve rdbuf()->sungetc() Traits::eof(), llama 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.

En cualquier caso, establece el gcount() contador a cero .

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.

Parámetros

(Ninguno)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

*this

Ejemplo

#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';
    }
}

Salida:

Ver también

Extrae caracteres.
(función miembro pública) [editar]

lee el siguiente carácter sin extraerlo

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.


(función miembro pública) [editar]

pone personaje en la corriente de entrada

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.


(función miembro pública) [editar]