Both user and system header files are included using the preprocessing directive ‘#include
’. It has two variants:
#include <
file>
-I
option (see Invocation). #include "
file"
<
file>
. You can prepend directories to the list of quote directories with the -iquote
option. The argument of ‘#include
’, whether delimited with quote marks or angle brackets, behaves like a string constant in that comments are not recognized, and macro names are not expanded. Thus, #include <x/*y>
specifies inclusion of a system header file named x/*y
.
However, if backslashes occur within file, they are considered ordinary text characters, not escape characters. None of the character escape sequences appropriate to string constants in C are processed. Thus, #include "x\n\\y"
specifies a filename containing three backslashes. (Some systems interpret ‘\
’ as a pathname separator. All of these also interpret ‘/
’ the same way. It is most portable to use only ‘/
’.)
It is an error if there is anything (other than comments) on the line after the file name.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/cpp/Include-Syntax.html