本帖最后由 aozima 于 2012-5-3 10:17 编辑
应该没什么不妥,很多人以为
a.c里面include了s1.h。- #ifndef __S1_H__
- #define __S1_H__
- unsigned char s1;
- #endif
而s1.h里面有
#define __S1_H__
所以
b.c里面再include s1.h就
#ifndef __S1_H__
不成立
事实上,#define __S1_H__在a.c编译完后就没了,b.c会继续 include
只有在a.c里面
重复
- #include <stdio.h>
- #include "s1.h"
- #include "s1.h"
- #include "s1.h"
这样子才有作用的。
|