Source file inclusion
来自cppreference.com
< cpp | preprocessor
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
包括其他源文件后,立即指令到当前源文件的行.
原文:
Includes other source file into current source file at the line immediately after the directive .
[编辑] 语法
#include < filename>
|
(1) | ||||||||
#include " filename"
|
(2) | ||||||||
[编辑] 解释
包括源文件,确定filename到当前的源文件后,立即指令在该行.
原文:
Includes source file, identified by filename into the current source file at the line immediately after the directive.
该指令的第一个版本只搜索标准包括目录。标准C + +库,作为标准C库,以及隐含在标准include目录。标准包括目录可以由用户通过编译器选项控制.
原文:
The first version of the directive searches only standard include directories. The standard C++ library, as well as standard C library, is implicitly included in standard include directories. The standard include directories can be controlled by the user through compiler options.
第二个版本首先搜索当前文件所在的目录下,并只有当文件没有找到,搜索的标准包括目录.
原文:
The second version firstly searches the directory where the current file resides and, only if the file is not found, searches the standard include directories.
在的情况下,文件没有找到,程序是格式错误的.
原文:
In the case the file is not found, program is ill-formed.