ITeye博客

.h文件引用的一些规范

hellsing42 · 2012-07-04 13:57 · c/c++ · 移动开发 · Markdown

对于.h的引用要使用#ifndef #define #endif去防止.h文件多次被引用。 例如 a_test.h:

#ifndef a_test_h
#define a_test_h

h内容
...
...
...
...

#endif

这种格式,h文件实际在编译时会把.h文件的内容复制到相应的c文件中!

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。