The function behaves as if successive calls to sputc were made with each character, until n characters were written or until sputc would have returned EOF (or traits::eof() for other traits).
Parameters
- s
- Pointer to the sequence of characters to be output.
- n
- Number of character to be put. This is an integer value of type streamsize.
Return Value
The number of characters written, returned as a value of type streamsize.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
This short example writes a sentence to a file using streambuf's member sputn.
Basic template member declaration
( basic_streambuf<charT,traits> )| 1 2 |
|
See also
| streambuf::sgetn | Get sequence of characters (public member function) |
| streambuf::sputc | Store character at current put position and increase put pointer (public member function) |
