◐ Shell
clean mode source ↗

std::basic_istream::unget - cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Faz o personagem mais recentemente extraído disponível novamente.

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.

Primeiro limpa

eofbit

, em seguida, se comporta como UnformattedInputFunction. Depois de construir e verificar o objeto de sentinela, chama 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.

Se rdbuf()->sungetc() retornos Traits::eof(), chama 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.

Em qualquer caso, define o gcount() contador a zero.

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

(Nenhum)

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

Exemplo

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

Saída:

Veja também

extratos personagens

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.


(função pública membro) [edit]

lê o próximo caractere sem extraí-lo

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.


(função pública membro) [edit]

coloca personagem em fluxo 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.


(função pública membro) [edit]