包含用引号引起来的文件名Including Quoted Filenames

ANSI 3.8.2 对可包含的源文件的带引号名称的支持ANSI 3.8.2 The support for quoted names for includable source files

如果在两组双引号 (" ") 之间为包含文件指定完整明确的路径说明,则预处理器只搜索该路径说明并会忽略标准目录。If you specify a complete, unambiguous path specification for the include file between two sets of double quotation marks (" "), the preprocessor searches only that path specification and ignores the standard directories.

对于指定为 #include“path-spec”的包含文件,目录搜索从父文件的目录开始,然后在任何祖父级文件的目录中继续进行。For include files specified as #include "path-spec", directory searching begins with the directories of the parent file, then proceeds through the directories of any grandparent files. 因此,搜索将相对于包含当前正在处理的源文件的目录开始。Thus, searching begins relative to the directory containing the source file currently being processed. 如果没有祖父文件且未找到该文件,则搜索会像文件名括在尖括号中一样继续进行。If there is no grandparent file and the file has not been found, the search continues as if the filename were enclosed in angle brackets.

请参阅See Also

预处理指令Preprocessing Directives