UNGETC(3S) — HP-UX
NAME
ungetc − push character back into input stream
SYNOPSIS
#include <stdio.h>
int ungetc (c, stream)
int c;
FILE ∗stream;
DESCRIPTION
Ungetc inserts the character c into the buffer associated with an input stream. That character, c, will be returned by the next getc(3S) call on that stream. Ungetc returns c, and leaves the file corresponding to stream 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.
Fseek(3S) erases all memory of inserted characters.
RETURN VALUE
If successful, ungetc returns c; ungetc returns EOF if it cannot insert the character.
SEE ALSO
fseek(3S), getc(3S), setbuf(3S).
Hewlett-Packard Company — May 11, 2021