std::basic_streambuf<CharT,Traits>::sungetc (3) - Linux Manuals
std::basic_streambuf<CharT,Traits>::sungetc: std::basic_streambuf<CharT,Traits>::sungetc
NAME
std::basic_streambuf<CharT,Traits>::sungetc - std::basic_streambuf<CharT,Traits>::sungetc
Synopsis
int_type sungetc();
If a putback position is available in the get area (gptr() > eback()), then decrements the next pointer (gptr()) and returns the character it now points to.
If a putback position is not available, then calls pbackfail() to back up the input sequence if possible.
The I/O stream function basic_istream::unget is implemented in terms of this function.
Parameters
(none)
Return value
If putback position was available, returns the character that the next pointer is now pointing at, converted to int_type with Traits::to_int_type(*gptr()). The next single-character input from this streambuf will return this character.
If putback position was not available, returns what pbackfail() returns, which is Traits::eof() on failure.
Example
// Run this code
Output:
See also
sputbackc (public member function)
unget (public member function of std::basic_istream<CharT,Traits>)