what is #include Directive


The #include directive copies a file to a program. The #include directive is replaced by the content of the file. Syntax: #include <filename> #include "filename" If the file name is surrounded by <and >, the file will only be looked up in the directories defined by the environment variable (usually INCLUDE). If the file name is stated in quotes the file will also be looked up in the current directory first. The name filename can include a path. In this case the file is only looked up in the directory stated. You can also supply the file name as a symbolic constant. The substitute text must be in quotes or square brackets in this case.

#include <iostream> #include "project.h" #if VERSION == 1 #define myproject_h "version1.h" #else #define myproject_h "version2.h" #endif #include myproject_h