C #include Preprocessor directive

February 3, 2014

In C, #include is a preprocessing directive (C99, 6.10) to include source files (C99, 6.10.2). It has two variants:

#include <MyHeader.h>

Searches a sequence of implementation defined places for a header identified by the name within <> characters. Once found, the directive is replaced with the content of the header.

#include "MyHeader.h"

Searches for a header identified at the path within "" characters. Once found, the directive is replaced with the content of the header. If the search is not supported then it is interpreted as #include <MyHeader.h>

Discussion, links, and tweets

I'm a developer at IO Stark.