STDIO(S) XENIX System V STDIO(S)
Name
stdio - Performs standard buffered input and output.
Syntax
#include <stdio.h>
FILE *stdin, *stdout, *stderr;
Description
The stdio library contains an efficient, user-level I/O
buffering scheme. The in-line macros getc(S) and putc(S)
handle characters quickly. The macros getchar, putchar, and
the higher-level routines fgetc, fgets, fprintf, fputc,
fputs, fread, fscanf, fwrite, gets, getw, printf, puts,
putw, and scanf all use getc and putc; they can be freely
intermixed.
A file with associated buffering is called a ``stream'' and
is declared to be a pointer to a defined type FILE .
fopen(S) creates certain descriptive data for a stream and
returns a pointer to designate the stream in all further
transactions. Normally, there are three open streams with
constant pointers declared in the ``include'' file and
associated with the standard open files:
stdin Standard input file
stdout Standard output file
stderr Standard error file
A constant ``pointer'' NULL designates the null stream.
An integer constant EOF is returned upon end-of-file or
error by most integer functions that deal with streams (see
the individual descriptions for details).
Any program that uses this package must include the header
file of pertinent macro definitions, as follows:
#include <stdio.h>
Most of the functions and constants mentioned in this
section of the manual are declared in that ``include'' file
and are described elsewhere. The constants and the
following ``functions'' are implemented as macros
(redeclaration of these names is perilous): getc, getchar,
putc, putchar, feof, ferror, and fileno.
Page 1 (printed 8/7/87)
STDIO(S) XENIX System V STDIO(S)
See Also
open(S), close(S), read(S), write(S), ctermid(S),
cuserid(S), fclose(S), ferror(S), fopen(S), fread(S),
fseek(S), getc(S), gets(S), popen(S), printf(S), putc(S),
puts(S), scanf(S), setbuf(S), system(S), tmpnam(S)
Diagnostics
Invalid stream pointers can cause grave disorder, possibly
including program termination. Individual function
descriptions describe the possible error conditions.
Page 2 (printed 8/7/87)