During its operation, the function will call the protected virtual member function underflow if the get pointer gptr points to the same position as the end pointer egptr before the call (or if it is a null pointer).
Unlike the member functions sbumpc and snextc, this function does not advance the get pointer neither before nor after reading it.
Parameters
noneReturn Value
The character pointed by the get pointer (type-casted to the appropiate return type).If the controlled input sequence has exhausted, and underflow could not retrieve more characters, the function returns EOF (or traits::eof() for other traits).
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
This example shows the content of a file on screen, using a combination of sgetc and sbumpc to read the file.
Basic template member declaration
( basic_streambuf<charT,traits> )| 1 2 |
|
See also
| streambuf::snextc | Increase get pointer and return next character (public member function) |
| streambuf::sbumpc | Get current character and increase get pointer (public member function) |
| streambuf::sgetn | Get sequence of characters (public member function) |
| streambuf::sputc | Store character at current put position and increase put pointer (public member function) |
