.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" This code is derived from software contributed to Berkeley by
.\" Chris Torek and the American National Standards Committee X3,
.\" on Information Processing Systems.
.\" %sccs.include.redist.man%
.\" @(#)ungetc.3 6.6 (Berkeley) %G%
.Nd un-get character from input stream
.Fn ungetc "int c" "FILE *stream"
function pushes the character
(converted to an unsigned char)
back onto the input stream pointed to by
The pushed-backed characters will be returned by subsequent reads on the
stream (in reverse order).
A successful intervening call, using the same stream, to one of the file
will discard the pushed back characters.
One character of push-back is guaranteed,
sufficient memory, an effectively infinite amount of pushback is allowed.
If a character is successfully pushed-back,
the end-of-file indicator for the stream is cleared.
the character pushed-back after the conversion, or
If the value of the argument
the operation will fail and the stream will remain unchanged.