NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
#include <stdio.h>int ungetc(int c, FILE *stream);
The ungetc function inserts the character c into the buffer associated with an input stream. The c character will be returned by the next getc (3STDC) call on that stream. The ungetc function returns c, and leaves the stream file unchanged.
One character of pushback is guaranteed, provided something has already been read from the stream and the stream is actually buffered.
If c equals EOF, ungetc does nothing to the buffer and returns EOF.
Using fseek(3STDC) erases all memory of inserted characters.
The ungetc function returns EOF if it cannot insert the character.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO