std::ends
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. |
Elemento definito nell'header <ostream> | ||
template<class CharT, class Traits > std::basic_ostream<charT,traits>& ends(std::basic_ostream<CharT, Traits>& os ); | ||
Inserisce un carattere null nella sequenza di output
os
come se chiamando 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.
Si tratta di un solo output manipolatore di I / O, può essere chiamato con espressioni quali out << std::ends per qualsiasi
out
di 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.
Indice |
[modifica]Note
Il manipolatore è in genere utilizzato con std::ostrstream, quando il buffer di uscita associata deve essere null-terminata da trattare come una stringa 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.
A differenza di std::endl, questo manipolatore non lavare il flusso.
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.
[modifica]Parametri
os | - | riferimento al flusso di output 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. |
[modifica]Valore di ritorno
os
(riferimento al flusso dopo l'inserimento del carattere null)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.
[modifica]Esempio
#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}
Output:
Sample text: 42
[modifica]Vedi anche
(deprecato) | implementa operazioni di output di array di caratteri 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) |