.\" Copyright (c) 1990 The Regents of the University of California.
.\" This code is derived from software contributed to Berkeley by
.\" %sccs.include.redist.man%
.\" @(#)getc.3 6.4 (Berkeley) %G%
fgetc, getc, getchar, getw \- get a character or word from a stream
returns the next input character from the given
or the next character pushed back via
acts essentially identically to
but is a macro that expands in-line.
is identical to ``getc(stdin)''.
These functions return the integer constant
at end-of-file, upon read error, or if an attempt is made to read a
to distinguish between end-of-file and error.
If an error occurs, the global variable
is set to indicate the error.
The end-of-file condition is remembered, even on a terminal, and all
subsequent attempts to read will return
until the condition is cleared with
ferror(3), fread(3), fopen(3), putc(3), ungetc(3)
is a valid integer value,
must be used to check for failure after calling
The size and byte order of an
varies from one machine to another, and
is not recommended for portable applications.
Because it is implemented as a macro,
argument with side effects incorrectly.
In particular, ``getc(*f++);'' may not work sensibly.
conform to ANSI X3.159-1989 (``ANSI C'').