File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / stdio / ungetc.3
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

.\"	@(#)ungetc.3	6.2 (Berkeley) 4/1/89
.\"
.TH UNGETC 3  "April 1, 1989"
.AT 3
.SH NAME
ungetc \- push character back into input stream
.SH SYNOPSIS
.B #include <stdio.h>
.PP
.B ungetc(c, stream)
.br
.SM
.B FILE
.B *stream;
.SH DESCRIPTION
.I Ungetc
pushes the character
.I c
back on an input stream.  That character will be returned by the next
.I getc
call on that stream.
.I Ungetc 
returns 
.IR c .
.PP
One character of pushback is guaranteed provided
something has been read from the stream and the stream is actually buffered.
Attempts to push EOF are rejected.
.PP
.IR  Fseek (3)
erases all memory of pushed back characters.
.SH "SEE ALSO"
getc(3),
setbuf(3),
fseek(3)
.SH DIAGNOSTICS
.I Ungetc
returns
.SM
.B EOF
if it can't push a character back.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.