#include directive — Includes another source file
header> #include "
includes the contents of a standard header or source file. The first
form searches for
header and replaces the
directive with the entire contents of the header. The second form
sourcefile and replaces the
directive with the entire contents of the named source file.
The basic action of
is to read the named file or header as though its entire contents
appeared in the source file at the position of the
#include directive. Typically, common
declarations are placed in a separate file, such as decl.h, and
decl.h" is used in every source file that
depends on those declarations.
If a source file contains the directive
filename", and the compiler cannot find
the external file named
compiler also tries the form
>. Most compilers implement
these two forms of
searching in different folders or directories. For example, the quote
form searches in the current directory or in the directory that
contains the source file, and the angle-bracket form searches only in
"system" directories. Such details are implementation-defined, and
some compilers might introduce further distinctions between the two
It is possible, for example, for a compiler to recognize only the standard headers in the ...