在:http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/C++ - 我怎样才能避免这个标题出现两次?
在部首警卫,还有那些代码片断:
add.h:
#include "mymath.h"
int add(int x, int y);
subtract.h:
#include "mymath.h"
int subtract(int x, int y);
main.cpp中:
#include "add.h"
#include "subtract.h"
如何避免#include "mymath.h"
在main.cpp
中出现两次?
感谢。
为什么你想避免它包括两次? – sth 2011-01-22 17:24:54