During its operation, the function will call the protected virtual member function uflow if the get pointer gptr reaches the end pointer egptr (or if it is a null pointer).
Notice that, although similar, the following functions have different behaviors:
- sgetc: returns the character pointed by the get pointer.
- sbumpc: advances the get pointer and returns the character pointed by it before the call.
- snextc: advances the get pointer and returns the character pointed by it after the call.
Parameters
noneReturn Value
The character pointed by the new position of the get pointer (type-casted to the appropiate return type).If the controlled input sequence has exhausted, and uflow 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 |
|
This example shows the content of a file on screen, using the combination of sgetc and snextc to read the input file.
Basic template member declaration
( basic_streambuf<charT,traits> )| 1 2 |
|
See also
| streambuf::sbumpc | Get current character and increase get pointer (public member function) |
| streambuf::sgetc | Get current character (public member function) |
| streambuf::sgetn | Get sequence of characters (public member function) |
