std::basic_istream::operator>>
Da cppreference.com.
< cpp | io | basic istream
![]() |
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. |
basic_istream& operator>>( short& value ); basic_istream& operator>>( unsigned short& value ); |
(1) | |
basic_istream& operator>>( int& value ); basic_istream& operator>>( unsigned int& value ); |
(2) | |
basic_istream& operator>>( long& value ); basic_istream& operator>>( unsigned long& value ); |
(3) | |
basic_istream& operator>>( long long& value ); basic_istream& operator>>( unsigned long long& value ); |
(4) | (dal C++11) |
basic_istream& operator>>( float& value ); basic_istream& operator>>( double& value ); |
(5) | |
basic_istream& operator>>( bool& value ); |
(6) | |
basic_istream& operator>>( void*& value ); |
(7) | |
basic_istream& operator>>( basic_istream& st, std::ios_base& (*func)(std::ios_base&) ); |
(8) | |
basic_istream& operator>>( basic_istream& st, std::basic_streambuf<CharT,Traits>* sb ); |
(9) | |
Estratti un valore intero chiamando num_get::get()
5) Original:
Extracts an integer value by calling num_get::get()
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.
Estrae un valore in virgola mobile chiamando num_get::get()
6) Original:
Extracts a floating point value by calling num_get::get()
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.
Estratti bool valore chiamando num_get::get()
7) Original:
Extracts bool value by calling num_get::get()
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.
Estrae un valore generico puntatore chiamando num_get::get()
8) Original:
Extracts a generic pointer value by calling num_get::get()
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.
Chiede func(*this);, dove
9) func
è un manipolatore di I / O.Original:
Calls func(*this);, where
func
is an I/O manipulator.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.
Si comporta come un
UnformattedInputFunction
. Dopo la costruzione e la verifica dell'oggetto sentinella, estrae tutti i dati dal flusso di input e lo memorizza per sb
. L'estrazione si interrompe se una delle seguenti condizioni:Original:
Behaves as an
UnformattedInputFunction
. After constructing and checking the sentry object, extracts all data from the input stream and stores it to sb
. 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.
- end-of-file avviene sulla sequenza di input;Original:end-of-file occurs on the input sequence;The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - inserire nella sequenza di uscita fallisce (nel qual caso il carattere da inserire non viene estratto)Original:inserting in the output sequence fails (in which case the character to be inserted 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. - si verifica un'eccezione (in questo caso l'eccezione e 'colto).Original:an exception occurs (in which case the exception is caught).The 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, memorizza il numero di caratteri estratti nella variabile membro accede da chiamate successive a
gcount()
Original:
In either case, stores the number of characters extracted in the member variable accessed by subsequent calls to
gcount()
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.
Indice |
[modifica] Note
I (1-7) 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-7) 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.
La versione 8) non costruire l'oggetto sentinella. La versione 9) costruisce un oggetto sentinella con
noskipws
impostato true.Original:
The version 8) does not construct the sentry object. The version 9) constructs a sentry object with
noskipws
set to 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.
Se l'estrazione non riesce (ad esempio, se una lettera è stata inserita una cifra in cui è previsto),
value
viene lasciato invariato e failbit
è impostato (fino al c++11)Original:
If extraction fails (e.g. if a letter was entered where a digit is expected),
value
is left unmodified and failbit
is set (fino al c++11)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.
Se l'estrazione non riesce, lo zero viene scritto
value
e failbit
è impostato. Se i risultati di estrazione di valore troppo grande o troppo piccolo per stare in value
, std::numeric_limits<T>::max() o std::numeric_limits<T>::min() è scritto e bandiera failbit
è impostato. (dal C++11)Original:
If extraction fails, zero is written to
value
and failbit
is set. If extraction results in the value too large or too small to fit in value
, std::numeric_limits<T>::max() or std::numeric_limits<T>::min() is written and failbit
flag is set. (dal C++11)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.
[modifica] Parametri
value | - | riferimento a un valore intero o in virgola mobile per memorizzare il valore estratto Original: reference to an integer or floating-point value to store the extracted value to The text has been machine-translated via |