c/preprocessor/include

Includes another source file into the current source file at the line immediately after the directive.

Syntax
@1@ Searches for a header identified uniquely by and replaces the directive by the entire contents of the header. @2@ Searches for a source file identified by and replaces the directive by the entire contents of the source file. It may fallback to (1) and treat as a header identifier. @3@ If neither (1) and (2) is matched, will undergo macro replacement. The directive after replacement will be tried to match with (1) or (2) again. @4@ Checks whether a header or source file is available for inclusion. @5@ If (4) is not matched, will undergo macro replacement. The directive after replacement will be tried to match with (4) again.

Explanation
@1@ Searches for the file identified by in implementation-defined manner. The intent of this syntax is to search for the files under control of the implementation. Typical implementations search only standard include directories. The standard C library is implicitly included in these standard include directories. The standard include directories usually can be controlled by the user through compiler options.

@2@ Searches for the file identified by in implementation-defined manner. The intent of this syntax is to search for the files that are not controlled by the implementation. Typical implementations first search the directory where the current file resides and, only if the file is not found, search the standard include directories as with. @3@ The preprocessing tokens after in the directive are processed just as in normal text (i.e., each identifier currently defined as a macro name is replaced by its replacement list of preprocessing tokens). The directive resulting after all replacements shall match one of the two previous forms. The method by which a sequence of preprocessing tokens between and  preprocessing token pair or a pair of  characters is combined into a single header name preprocessing token is implementation-defined. @4@ The header or source file identified by or  is searched for as if that preprocessing token sequence were the  in syntax (3), except that no further macro expansion is performed. If such a directive would not satisfy the syntactic requirements of an directive, the program is ill-formed. The expression evaluates to  if the search for the source file succeeds, and to  if the search fails. @5@ This form is considered only if syntax (4) does not match, in which case the preprocessing tokens are processed just as in normal text.

In the case the file is not found, the program is ill-formed.