Is there a C++ version of ungetc?
That is, can I put a character back onto an istream?
Is there a C++ version of ungetc?
That is, can I put a character back onto an istream?
R. Martinho Fernandes
On
You can put a character back with the istream::putback function. You can even put a different character if you want.
Copyright © 2021 Jogjafile Inc.
Yes. istream::putback is the same as ungetc except if using unget():