Pushes a character back into the input stream and leaves the stream positioned before the character.
#include <stdio.h> int ungetc (int character, FILE *file_ptr);
One pushback is guaranteed, even if there has been no previous activity on the file. The fseek function erases all memory of pushed-back characters. The pushed-back character is not written to the underlying file. If the character to be pushed back is EOF, the operation fails, the input stream is left unchanged, and EOF is returned.
See also fseek and getc in this section.
x | The push-back character. |
EOF | Indicates it cannot push the character back. |