I have looked for some definitions and so far I know that unget()
must return the last character and putback()
can return others that are not the last one.
But my doubt would be in the run. I would like to know the practical uses, why is it used, it returns to where?
I did a test where I entered a char, I gave unget()
and then I used an entry in another variable and I noticed that it filled up with the returned character and I got a very superficial idea.
I would like you to explain to me this mechanic involving the buffer, the clean after an error, and the questions in the second paragraph.