Previous: Chapter 8
Up: Table of Contents
Previous Page: Chapter 8
Next Page: 8.1 The C Standard Library

8 Functions and Files

In this Chapter, we tie up some loose ends concerning some of the built in functions provided by the C language. In previous chapters we have been using such functions in our programming examples to do data input and output; functions such as scanf(), printf, getchar(), and putchar(). These routines are part of a library of standard routines. As we have seen, we can use these functions by including the header file in which they are declared (in this case < stdio.h>). These header files contain the prototypes for functions as well as macros that are needed for their use.

Previously, when we have needed routines for other operations (e.g. testing if a character is a digit), we have written our own. Such operations are common enough in C programs that the implementors have included predefined routines to perform them. These routines are collectively called the C Standard Library. We begin this Chapter by describing a few other built in functions provided in the Standard Library, describing their use and using them in a few sample programs. A longer (though not complete) listing of the Standard Library, together with descriptions, is provided in Appendix .

We next give a more thorough description of our I/O functions, scanf() and printf(). Finally, we discuss variations of the standard I/O routines, which allow direct access to data stored in files.



Previous: Chapter 8
Up: Table of Contents
Previous Page: Chapter 8
Next Page: 8.1 The C Standard Library

tep@wiliki.eng.hawaii.edu
Wed Aug 17 09:15:23 HST 1994