4.3BSD-Tahoe/usr/man/cat3/fgetc.0
GETC(3S) UNIX Programmer's Manual GETC(3S)
NNAAMMEE
getc, getchar, fgetc, getw - get character or word from
stream
SSYYNNOOPPSSIISS
##iinncclluuddee <<ssttddiioo..hh>>
iinntt ggeettcc((ssttrreeaamm))
FFIILLEE **ssttrreeaamm;;
iinntt ggeettcchhaarr(())
iinntt ffggeettcc((ssttrreeaamm))
FFIILLEE **ssttrreeaamm;;
iinntt ggeettww((ssttrreeaamm))
FFIILLEE **ssttrreeaamm;;
DDEESSCCRRIIPPTTIIOONN
_G_e_t_c returns the next character from the named input _s_t_r_e_a_m.
_G_e_t_c_h_a_r() is identical to _g_e_t_c(_s_t_d_i_n).
_F_g_e_t_c behaves like _g_e_t_c, but is a genuine function, not a
macro; it may be used to save object text.
_G_e_t_w returns the next iinntt (a 32-bit integer on a VAX-11)
from the named input _s_t_r_e_a_m. It returns the constant EEOOFF
upon end of file or error, but since that is a good integer
value, _f_e_o_f and _f_e_r_r_o_r(3S) should be used to check the suc-
cess of _g_e_t_w. _G_e_t_w assumes no special alignment in the
file.
SSEEEE AALLSSOO
clearerr(3S), fopen(3S), putc(3S), gets(3S), scanf(3S),
fread(3S), ungetc(3S)
DDIIAAGGNNOOSSTTIICCSS
These functions return the integer constant EEOOFF at end of
file, upon read error, or if an attempt is made to read a
file not opened by _f_o_p_e_n. The end-of-file condition is
remembered, even on a terminal, and all subsequent attempts
to read will return EEOOFF until the condition is cleared with
_c_l_e_a_r_e_r_r(3S).
BBUUGGSS
Because it is implemented as a macro, _g_e_t_c treats a _s_t_r_e_a_m
argument with side effects incorrectly. In particular,
`getc(*f++);' doesn't work sensibly.
Printed 7/9/88 May 14, 1986 1