All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)stdio.3 6.4 (Berkeley) 03/05/91
FILE *stdin;
FILE *stdout;
FILE *stderr;
A file with associated buffering is called a stream , and is declared to be a pointer to a defined type FILE . Fopen (3) and funopen (3) create certain descriptive data for a stream and return a pointer to designate the stream in all further transactions. There are three normally open streams with constant pointers declared in the include file and associated with the standard open files:
10n stdin standard input file
.ns
stdout standard output file
.ns
stderr standard error file
A constant `pointer' NULL (0) designates no stream at all.
An integer constant EOF (-1) is returned upon end of file or error by integer functions that deal with streams.
Any routine that uses the standard input/output package must include the header file < stdio.h > . The constants and functions listed here are declared in the include file and need no further declaration. The following are implemented as macros; these names may not be reused without first removing their current definitions with #undef : BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_cuserid, L_tmpnam, NULL, SEEK_END, SEEK_SET, SEE_CUR, TMP_MAX, clearerr, feof, ferror, fileno, fropen, fwopen, getc, getchar, putc, putchar, stderr, stdin, stdout. Function versions of the macro functions feof, ferror, clearerr, fileno, getc, getchar, putc, and putchar exist and will be used if the macros definitions are explicitly removed.
Output streams that refer to terminal devices are always line buffered by default; pending output to such streams is written automatically whenever an input stream that refers to a terminal device is read. In cases where a large amount of computation is done after printing part of a line on an output terminal, it is necessary to fflush (3) the standard output before going off and computing so that the output will appear.
all of the manual entries listed below
Name Appears on Page Description clearerr ferror.3 stream status inquiries fclose fclose.3 close a stream fdopen fopen.3 open a stream feof ferror.3 stream status inquiries ferror ferror.3 stream status inquiries fflush fflush.3 flush a stream fgetc getc.3 get a character or word from a stream fgetline fgetline.3 get a line from a stream fgetpos fseek.3 reposition a stream fgets fgets.3 get a line from a stream fileno ferror.3 stream status inquiries fmemopen fmemopen.3 open a block of memory as a stream fopen fopen.3 open a stream fprintf printf.3 formatted output conversion fpurge fpurge.3 discard buffered stream data fputc putc.3 put a character or word to a stream fputs fputs.3 put a line to a stream fread fread.3 stream binary input/output freopen fopen.3 open a stream fscanf scanf.3 formatted input conversion fseek fseek.3 reposition a stream fsetpos fseek.3 reposition a stream ftell fseek.3 reposition a stream funopen fopen.3 open a stream fwrite fread.3 stream binary input/output getc getc.3 get a character or word from a stream getchar getc.3 get a character or word from a stream gets fgets.3 get a line from a stream getw getc.3 get a character or word from a stream printf printf.3 formatted output conversion putc putc.3 put a character or word to a stream putchar putc.3 put a character or word to a stream puts fputs.3 put a line to a stream putw putc.3 put a character or word to a stream remove remove.3 remove a file rewind fseek.3 reposition a stream scanf scanf.3 formatted input conversion setbuf setvbuf.3 assign buffering to a stream setbuffer setvbuf.3 assign buffering to a stream setlinebuf setvbuf.3 assign buffering to a stream setvbuf setvbuf.3 assign buffering to a stream snprintf printf.3 formatted output conversion sprintf printf.3 formatted output conversion tmpfile tmpnam.3 create a temporary stream tmpnam tmpnam.3 create a temporary file name ungetc ungetc.3 push character back into input stream vfprintf printf.3 formatted output conversion vprintf printf.3 formatted output conversion vsnprintf printf.3 formatted output conversion vsprintf printf.3 formatted output conversion