include directive

From Cppwiki

Jump to: navigation, search


#include is a preprocessor directive. It performs direct text substitution of the file given as its argument into the parsed code.

There are two fors of #include, as follows:

 #include <filename>
 #include "filename"

The only difference between the two is the order of directory search. The "filename" form searches the current directory, then moves onto a set of include path directories, the <filename> form searches only the set of include path directories.

The named file should generally have include guards to prevent problems in case the file is the argument to more than one #include in a given translation unit.

Personal tools