ungetc pushes the character cval back on an input stream. That character will be returned by the next getc call on that stream. ungetc returns cval. One character of pushback is guaranteed provided something has been read from the stream and the stream is actually buffered.
Attempts to push EOF are rejected.
fseek erases all memory of pushed back characters.
ungetc returns EOF if it can't push a character back.
|