Bell 32V release
[unix-history] / usr / man / man3 / ungetc.3s
CommitLineData
c4665c80
TL
1.TH UNGETC 3S
2.SH NAME
3ungetc \- push character back into input stream
4.SH SYNOPSIS
5.B #include <stdio.h>
6.PP
7.B ungetc(c, stream)
8.br
9.SM
10.B FILE
11.B *stream;
12.SH DESCRIPTION
13.I Ungetc
14pushes the character
15.I c
16back on an input stream.
17That character will be returned by the next
18.I getc
19call on that stream.
20.I Ungetc
21returns
22.IR c .
23.PP
24One character of pushback is guaranteed provided
25something has been read from the stream and the stream is
26actually buffered.
27Attempts to push EOF are rejected.
28.PP
29.IR Fseek (3)
30erases all memory of pushed back characters.
31.SH "SEE ALSO"
32getc(3), setbuf(3), fseek(3)
33.SH DIAGNOSTICS
34.I Ungetc
35returns
36.SM
37.B EOF
38if it can't push a character back.