std::ends
Da 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. |
Definido no cabeçalho <ostream>
|
||
template< class CharT, class Traits > std::basic_ostream<charT,traits>& ends( std::basic_ostream<CharT, Traits>& os ); |
||
Insere um caractere nulo na sequência de saída
os
como se chamando os.put(CharT()). Original:
Inserts a null character into the output sequence
os
as if by calling os.put(CharT()). 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.
Esta é uma saída de somente manipulador de I / O, que pode ser chamada com uma indicação tal como para qualquer out << std::ends
out
de std::basic_ostream tipo.Original:
This is an output-only I/O manipulator, it may be called with an expression such as out << std::ends for any
out
of type std::basic_ostream.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.
Índice |
[editar] Notas
Este manipulador é normalmente utilizado com std::ostrstream, quando o buffer de saída associado precisa ser terminada em NULL para ser processado como uma string C.
Original:
This manipulator is typically used with std::ostrstream, when the associated output buffer needs to be null-terminated to be processed as a C string.
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.
Ao contrário std::endl, este manipulador não lave a corrente.
Original:
Unlike std::endl, this manipulator does not flush the stream.
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] Parâmetros
os | - | referência ao fluxo de saída
Original: reference to output stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Valor de retorno
os
(referência ao fluxo após a inserção do caractere nulo)Original:
os
(reference to the stream after insertion of the null character)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] Exemplo
#include <cstdio> #include <strstream> int main() { std::ostrstream oss; oss << "Sample text: " << 42 << std::ends; std::printf("%s\n", oss.str()); oss.freeze(false); // enable memory deallocation }
Saída:
Sample text: 42
[editar] Veja também
(obsoleta) |
implementa operações de caracteres de saída da matriz Original: implements character array output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |