Espaços nominais
Variantes
Acções

operator>><div class="t-tr-text">(Std :: basic_istream)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">(std::basic_istream)</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>

Da cppreference.com
< cpp‎ | io‎ | basic istream

 
 
De entrada / saída da biblioteca
I / O manipuladores
C estilo de I / O
Buffers
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(obsoleta)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstrações
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
File I / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
Cordas I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Matriz de I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(obsoleta)
ostrstream(obsoleta)
strstream(obsoleta)
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface de categoria de erro
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_istream
Objetos globais
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cin
wcin
Funções de membro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::basic_istream
basic_istream::~basic_istream
basic_istream::operator=(C++11)
Entrada formatada
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::operator>>
Entrada não formatado
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::get
basic_istream::peek
basic_istream::unget
basic_istream::putback
basic_istream::getline
basic_istream::ignore
basic_istream::read
basic_istream::readsome
basic_istream::gcount
Posicionamento
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::tellg
basic_istream::seekg
Diversos
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::sync
basic_istream::swap(C++11)
Aulas-Membros
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::sentry
Não-membros funções
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator>>(std::basic_istream)
 
template< class CharT, class Traits >

basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>& st, CharT& ch );

template< class Traits >
basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, signed char& ch );

template< class Traits >

basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, unsigned char& ch );
(1)
template< class CharT, class Traits>

basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>& st, CharT* s );

template< class Traits >
basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, signed char* s );

template< class Traits >

basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, unsigned char* s );
(2)
template< class CharT, class Traits, class T >
basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>&& st, T& value );
(3) (a partir do C++ 11)
Executa operações de entrada de caracteres.
Original:
Performs character input operations.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Extrai um personagem e guarda-a para ch.
Original:
Extracts a character and stores it to ch.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Extrai os caracteres sucessivos e armazena-os em locais sucessivos de uma matriz de caracteres cujo primeiro elemento é apontado por s. A extração pára se uma das seguintes condições:
Original:
Extracts successive characters and stores them at successive locations of a character array whose first element is pointed to by s. The extraction stops if one of the following conditions are met:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • um carácter em branco (como determinado pela faceta ctype<CharT>) é encontrado. O personagem espaços em branco não é extraído.
    Original:
    a whitespace character (as determined by the ctype<CharT> facet) is found. The whitespace character is not extracted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • this->width() - 1 personagens são extraídos
    Original:
    this->width() - 1 characters are extracted
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Em ambos os casos, um adicional de valor nulo CharT() caracteres é armazenado no fim da saída.
Original:
In either case, an additional null character value CharT() is stored at the end of the output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Chama o operador de extração adequado, dada uma referência a um objeto rvalue fluxo de entrada (equivalente a st >> value).
Original:
Calls the appropriate extraction operator, given an rvalue reference to an input stream object (equivalent to st >> value).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Notas

As versões (1-2) do operador de comportar-se como funções de entrada formatados. Isto é, construir um objeto sentry no início que libera o empate () 'd buffers, se necessário, verifica os erros e extratos e descarta todos os caracteres espaço em branco, a menos que o ios_base :: bandeira skipws foi desmarcada. A entrada é tentada apenas se o objecto sentry retorna true.
Original:
The (1-2) versions of the operator behave as formatted input functions. That is, they construct a sentry object at the beginning that flushes the tie()'d buffers if needed, checks for errors, and extracts and discards all leading whitespace characters unless the ios_base::skipws flag was cleared. The input is attempted only if the sentry object returns true.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Parâmetros

st -
fluxo de entrada para extrair os dados a partir de
Original:
input stream to extract the data from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ch -
referência a um personagem para armazenar o personagem extraído
Original:
reference to a character to store the extracted character to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
s -
ponteiro para uma cadeia de caracteres para armazenar os caracteres extraído
Original:
pointer to a character string to store the extracted characters to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

st

[editar] Exemplo

#include <iostream>
#include <iomanip>
#include <sstream>
 
int main()
{
    std::string input = "n greetings";
    std::istringstream stream(input);
    char c;
    const int MAX = 6;
    char cstr[MAX];
 
    stream >> c >> std::setw(MAX) >> cstr;
    std::cout << "c = " << c << '\n'
              << "cstr = " << cstr << '\n';
 
    double f;
    std::istringstream("1.23") >> f; // rvalue stream extraction
    std::cout << "f = " << f << '\n';
}

Output:

c = n
cstr = greet
f = 1.23

[editar] Veja também

extratos dados formatados
Original:
extracts formatted data
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]