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>
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| template< class CharT, class Traits > basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>& st, CharT& ch ); |
(1) | |
| template< class CharT, class Traits> basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>& st, CharT* s ); |
(2) | |
| template< class CharT, class Traits, class T > basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>&& st, T& value ); |
(3) | (ya que C + +11) |
You can help to correct and verify the translation. Click here for instructions.
ch .ch.You can help to correct and verify the translation. Click here for instructions.
s. La extracción se detiene si una de las condiciones siguientes:s. The extraction stops if one of the following conditions are met:You can help to correct and verify the translation. Click here for instructions.
- un carácter de espacio (como se determina por la faceta ctype<CharT>) se encuentra. El espacio en blanco no se extrae .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 caracteres se extraenOriginal:this->width() - 1 characters are extractedThe 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.
You can help to correct and verify the translation. Click here for instructions.
Contenido |
[editar] Notas
sentry al principio que vacía el empate () 'd tampones si es necesario, el control de errores, así como extractos y descarta todos los principales espacios en blanco a menos que la bandera ios_base :: skipws fue absuelto. La entrada se trató sólo si el objeto sentry devuelve true .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.You can help to correct and verify the translation. Click here for instructions.
[editar] Parámetros
| st | - | flujo de entrada para extraer los datos 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 | - | referencia a un carácter para almacenar el carácter extraídos
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 | - | puntero a una cadena de caracteres para almacenar los caracteres extraídos
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] Ejemplo
#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] Ver también
| extractos de formato de datos 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. (miembro público función) | |