Site hosted by Angelfire.com: Build your free website today!

Table of Contents Previous Next


1.12 The Standard Headers: <stdio.h>

The input and output functions, types and macros defined in <stdio.h> represent nearly one third of the library.

A stream is a source or destination of data that may be associated with a disk or other peripheral.  The library supports text streams and binary streams, although on some systems, notably UNIX, these are identical.  A text stream is a sequence of lines; each line has zero or more characters and is terminated by '\n'.  An environment may need to convert a text stream to or from some other representation (such as mapping '\n' to carriage return and linefeed).  A binary stream is a sequence of unprocessed bytes that record internal data, with the property that if it written, then read back on the same system, it will compare equal.

A stream is connected to a file or device by opening it; the connection is broken by closing the stream.  Opening a file returns a pointer to an object of type FILE, which records whatever information is necessary to control the stream.  We will use "file pointer" and "stream" interchangeably when there is no ambiguity.

When a program begins execution, the three streams stdin, stdout, and stderr are already open.


1.12.1 File Operations

1.12.2 Formatted Output

1.12.3 Formatted Input

1.12.4 Character Input and Output Functions

1.12.5 Direct Input and Output Functions

1.12.6 File Positioning Functions

1.12.7 Error Functions


Table of Contents Previous Next

Last modified: Fri Feb 25 13:50:56 2000