std::basic_ostream::tellp
De cppreference.com
|
|
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. |
<metanoindex/>
<tbody> </tbody> pos_type tellp(); |
||
Retorna o indicador de posição de saída do objeto atual
streambuf associado.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.
Primeiro, constrói um objeto sentry que verifica o fluxo de erros e libera o empate () 'saída d (desde C++11) córregos. Depois, se
fail()==true, retorna pos_type(-1). Caso contrário, retorna 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.
Parâmetros
(Nenhum)
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.
Valor de retorno
indicador de posição de corrente de saída em caso de sucesso,
pos_type(-1) se ocorrer uma falha.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.
Exemplo
#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();
}
Saída:
0
1
13
18
hello, world 3.14
Veja também
define o indicador de posição de saída 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. (função pública membro) | |
retorna o indicador de posição 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. (of std::basic_istream função pública membro)
| |
| sets the input position indicator (of std::basic_istream função pública membro)
|