.TH ungetc() "" "" "STDIO Function (libc)"
.PC "Return character to input stream"
.B "#include <stdio.h>"
\fBint ungetc (\fIc\fB, \fIfp\^\fB)\fR
\fBint \fIc\^\fB; FILE *\fIfp\^\fB;\fR
.PP
.B ungetc()
returns the character \fIc\fR to the stream \fIfp\fR.
.I c
can then be read by a subsequent call to \fBgetc()\fR, \fBgets()\fR,
\fBgetw()\fR, \fBscanf()\fR, or \fBfread()\fR.
No more than one character can be pushed back into any stream at once.
A call to \fBfseek()\fR will nullify the effects of a previous
\fBungetc()\fR.
.PP
.B ungetc()
normally returns
.IR c .
It returns
.B EOF
if the character cannot be pushed back.
.SH Example
For an example of this function, see
.BR fgetc() .
.SH "See Also"
.Xr "fgetc()," fgetc
.Xr "getc()," getc
.Xr "libc" libc
.br
\*(AS, \(sc7.9.7.11
.br
\*(PX Standard, \(sc8.1
