std::basic_istream::tellg
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> pos_type tellg(); |
||
Returns input position indicator of the current associated streambuf object.
Behaves as UnformattedInputFunction. After constructing and checking the sentry object, if fail()==true, returns pos_type(-1). Otherwise, returns rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::in).
Parametri
(Nessuno)
Original:
(none)
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.
Valore di ritorno
current position of the get pointer on success, pos_type(-1) on failure
Esempio
#include <iostream>
#include <string>
#include <sstream>
int main()
{
std::string str = "Hello, world";
std::istringstream in(str);
std::string word;
in >> word;
std::cout << "After reading the word \"" << word
<< "\" tellg() returns " << in.tellg() << '\n';
}
Output:
After reading the word "Hello," tellg() returns 6
Vedi anche
| sets the input position indicator (metodo pubblico) | |
restituisce l'indicatore di posizione di uscita Original: returns the output position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
imposta l'indicatore di posizione di uscita Original: sets the output position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |