std::basic_ostream<CharT,Traits>::tellp
De cppreference.com
< cpp | io | basic ostream
![]() | Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate. La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
pos_type tellp(); | ||
Devuelve el indicador de posición de salida del objeto
streambuf
corriente asociada .Original:
Returns the output position indicator of the current associated
streambuf
object.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.
En primer lugar, construye un objeto sentry que controla el flujo de los errores y los colores de la corbata () 'd flujos de salida (desde C++11). Después, si fail()==true, devuelve pos_type(-1). De lo contrario, devuelve rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out) .
Original:
First, constructs a sentry object which checks the stream for errors and flushes the tie()'d output streams (desde C++11). Afterwards, if fail()==true, returns pos_type(-1). Otherwise, returns rdbuf()->pubseekoff(0, std::ios_base::cur, std::ios_base::out).
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.
Contenido |
[editar]Parámetros
(Ninguno)
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.
[editar]Valor de retorno
Indicador de posición de salida de corriente en caso de éxito, pos_type(-1) si se produce un error .
Original:
current output position indicator on success, pos_type(-1) if a failure occurs.
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.
[editar]Ejemplo
Ejecuta este código
#include <iostream>#include <sstream>int main(){std::ostringstream s;std::cout<< s.tellp()<<'\n'; s <<'h';std::cout<< s.tellp()<<'\n'; s <<"ello, world ";std::cout<< s.tellp()<<'\n'; s <<3.14<<'\n';std::cout<< s.tellp()<<'\n'<< s.str();}
Salida:
0 1 13 18 hello, world 3.14
[editar]Ver también
Establece el indicador de la posición de salida. (función miembro pública) | |
devuelve el indicador de posición de entrada Original: returns the input position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro pública de std::basic_istream ) | |
Establece el indicador de la posición de entrada. (función miembro pública de std::basic_istream ) |