During its operation, the function will call the protected virtual member function pbackfail if the get pointer gptr points to the same position as the beginning pointer eback.
Parameters
noneReturn Value
The value of the character in the new get pointer position.If the get pointer is at the beginning of the input sequence 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 24 25 26 27 28 |
|
This example gets characters form standard input one by one. When the first numeric digit is found, sungetc is called to restore the position in the stream to that digit in order to be extracted as part of a number using the extraction operator >>.
Basic template member declaration
( basic_streambuf<charT,traits> )| 1 2 |
|
See also
| streambuf::sputbackc | Put character back (public member function) |
| streambuf::sgetc | Get current character (public member function) |
| 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::sputc | Store character at current put position and increase put pointer (public member function) |
