std::basic_streambuf::sputn, std::basic_streambuf::xsputn
Da cppreference.com.
< cpp | io | basic streambuf
![]() | 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. |
std::streamsize sputn(const char_type* s, std::streamsize count ); | (1) | |
protected: virtualstd::streamsize xsputn(const char_type* s, std::streamsize count ); | (2) | |
Chiamate
2) xsputn(s, count)
della classe più derivata.Original:
Calls
xsputn(s, count)
of the most derived class.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.
Scrive i caratteri
count
alla sequenza di uscita dalla matrice di caratteri il cui primo elemento è puntato da s
. I caratteri sono scritti come per le chiamate ripetute sputc()
. La scrittura si interrompe quando sia caratteri count
vengono scritti o una chiamata a sputc()
sarebbe tornato traits::eof().Original:
Writes
count
characters to the output sequence from the character array whose first element is pointed to by s
. The characters are written as if by repeated calls to sputc()
. Writing stops when either count
characters are written or a call to sputc()
would have returned traits::eof().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.
Se l'area è piena messo (pptr()==epptr()), questa funzione può chiamare
overflow()
, o ottenere l'effetto di overflow()
chiamando da qualche altra parte, non specificato, si intende.Original:
If the put area becomes full (pptr()==epptr()), this function may call
overflow()
, or achieve the effect of calling overflow()
by some other, unspecified, means.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]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.
[modifica]Valore di ritorno
Il numero di caratteri scritti con successo.
Original:
The number of characters successfully written.
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 <iostream>#include <sstream> int main(){std::ostringstream s1;std::streamsize sz = s1.rdbuf()->sputn("This is a test", 14); s1 <<'\n';std::cout<<"The call to sputn() returned "<< sz <<'\n'<<"The output sequence contains "<< s1.str(); std::istringstream s2; sz = s2.rdbuf()->sputn("This is a test", 14);std::cout<<"The call to sputn() on an input stream returned "<< sz <<'\n';}
Output:
The call to sputn() returned 14 The output sequence contains This is a test The call to sputn() on an input stream returned 0
[modifica]Vedi anche
Invoca xsgetn() Original: invokes xsgetn() The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |