【发布时间】:2016-02-03 03:19:55
【问题描述】:
预编译器的范围是否定义了它定义的文件? 例如:
三个文件:
test1.hpp/test1.cpp
test2.hpp/test2.cpp
test3.hpp/test3.cpp
test1.cpp 内的一个:
#ifndef test1_hpp
#define test1_hpp
// some declarations
#endif
test2.hpp 和 test.hpp 都是 #include test1.hpp。如果 test1_hpp 的范围是整个应用程序,据我了解,只有一个包含 test1.hpp 成功。因为一旦包含,test1_hpp 就被定义了。
【问题讨论】:
-
"独家新闻" => "范围"?另外,请确保将代码标记为代码(缩进 4 个空格)。
-
请给出一个具体的例子来说明你所说的那种变量。
-
An within test1.cpp:你的意思是test1.**hpp*?
标签: c++ precompile