INCLUDE - using include files.

There are two forms of the #include directive. Both forms have the effect of reading in a file and replacing the #include directive with the contents of the file (presumably C source code). The difference between the two is the way in which they search for the file whose contents you want to include.

#include "file"

begins searching for the desired file in the catalog that contains the original source file. If the inclusion file is not found under this directory, C will continue its search under the catalog

C_G8_SS/8CL3.3/INCLUDE

This catalog contains a number of standard "inclusion files" that are part of the multi-segment C software package.

When the form of the #include directive is

#include <file>

C does not bother searching the catalog that contained the original source file. Instead, it goes directly to C_G8_SS/8CL3.3/INCLUDE. This is the usual way to obtain a standard inclusion file, e.g.

#include <stdio.h>

The standard inclusion files under C_G8_SS/8CL3.3/INCLUDE have explanations available through the EXPLAIN command. See "expl c include NAME", where NAME is the name of the file you want (without the ".h" on the end). For example, "expl c include ctype" explains the contents of <ctype.h>.

If it ever becomes necessary for you to examine the contents of a standard #include file (e.g. to find out the actual value of a manifest symbol), simply read the appropriate file. For example, if you want to examine <stdio.h>, look at

c_g8_ss/8cl3.3/include/stdio.h

See Also:

expl c include index
for a list of what explanations are available

Copyright © 1996, Thinkage Ltd.