跳到主要内容

include

#include "defs.h"
#include <mudlib.h>

#include textually splices another file into the one being compiled: the effect is exactly as if the contents of the header had been typed at the point of the directive. Each object that includes a file gets its own compiled copy of whatever the file contains — so headers are for #defines, prototypes and shared declarations, while shared code belongs in an inherited object.

The "file" form searches relative to the including file's directory first and then the include path; the <file> form searches only the include path. For the full resolution rules, macro file names, trailing comments, and nesting limits, see the preprocessor reference: #include.