Name

ungetc function — Pushes a character back for reading later

Synopsis

int ungetc(int c, FILE* stream)

The ungetc function pushes back the character c (which must be an unsigned char), so the next read from stream will return c. The standard guarantees that you can push back just one character, though in some situations, you may be able to push back more.

The return value is c for success or EOF for an error.