std::basic_istream<CharT,Traits>::putback (3) - Linux Man Pages
basic_istream& putback( char_type ch );
Puts the character ch back to the input stream so the next extracted character will be ch.
First clears eofbit, then behaves as UnformattedInputFunction. After constructing and checking the sentry object, if rdbuf() is not null, calls rdbuf()->sputbackc(ch), which calls rdbuf()->pbackfail(ch) if ch does not equal the most recently extracted character.
If rdbuf() is null or if rdbuf->sputbackc(ch) returns Traits::eof(), calls setstate(badbit).
In any case, sets the gcount() counter to zero.
ch - character to put into input stream
failure if an error occurred (the error state flag is not goodbit) and exceptions() is set to throw for that state.
If an internal operation throws an exception, it is caught and badbit is set. If exceptions() is set for badbit, the exception is rethrown.
demonstrates the difference between modifying and non-modifying putback()
// Run this code
sputbackc (public member function of std::basic_streambuf<CharT,Traits>)
unget (public member function)
peek (public member function)