有没有办法在c ++ header中定义fastant foo" foo.hpp"
const int foo;
并使用" bar.hpp"中定义的功能栏返回的值对其进行初始化。
int bar();
? (在foo.hpp或foo.cpp中。)
答案 0 :(得分:1)
答案 1 :(得分:1)
写
extern const int foo;
foo.hpp 和中的
const int foo = bar();
foo.cpp 中的。