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.
|
|
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. |
<metanoindex/>
<tbody> </tbody> 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) | (dal C++11) |
Esegue operazioni di input dei caratteri.
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.
You can help to correct and verify the translation. Click here for instructions.
1)
Estrae un carattere e lo memorizza per
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.
You can help to correct and verify the translation. Click here for instructions.
2)
Estrae i caratteri successivi e li memorizza in posizioni successive di un array di caratteri il cui primo elemento è puntato da
s. L'estrazione si interrompe se una delle seguenti condizioni: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.
You can help to correct and verify the translation. Click here for instructions.
- uno spazio bianco (come determinato dalla sfaccettatura ctype<CharT>) si trova. Il carattere di spazio non viene estratto.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. - Caratteri
this->width() - 1sono estrattiOriginal:this->width() - 1characters are extractedThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
In entrambi i casi, un ulteriore carattere nullo
CharT() valore viene memorizzato al termine dell'uscita.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.
You can help to correct and verify the translation. Click here for instructions.
3)
Chiama l'operatore di estrazione appropriato, dato un riferimento a un oggetto rvalue flusso di input (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.
You can help to correct and verify the translation. Click here for instructions.
Note
I (1-2) versioni del gestore si comportano come funzioni di ingresso in formato. Cioè, costruire un oggetto
sentry all'inizio che svuota il legame () 'd buffer, se necessario, i controlli per gli errori, e gli estratti ed elimina tutti i caratteri di spazi bianchi a meno che il ios_base :: bandiera skipws è stato cancellato. L'ingresso è utilizzato solo se l'oggetto sentry restituisce 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.
You can help to correct and verify the translation. Click here for instructions.
Parametri
| st | - | flusso di input per estrarre i dati da
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 | - | riferimento a un carattere per memorizzare il carattere estratto
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 | - | puntatore a una stringa di caratteri per memorizzare i caratteri estratti
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. |
Valore di ritorno
st
Esempio
#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
Vedi anche
estratti i dati formattati 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. (metodo pubblico) | |