If less than n characters are available in the input sequence the function returns all the available characters, as if successive calls to sbumpc were made until an EOF (or traits::eof() for other traits) was returned.
Parameters
- s
- Pointer to a block of memory where the character sequence is to be stored.
- n
- Number of characters to be gotten. This is an integer value of type streamsize.
Return Value
The number of characters gotten, 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 19 20 21 |
|
This example gets the first ten characters of the file buffer and prints them out.
Basic template member declaration
( basic_streambuf<charT,traits> ) |
See also
| streambuf::sgetc | Get current character (public member function) |
| streambuf::sputn | Write a sequence of characters (public member function) |
| streambuf::sputc | Store character at current put position and increase put pointer (public member function) |
