/*module1.h*/
extern int a; /* 在模块1 的.h 文件中声明int a */
/*module1 .c*/
#include "module1.h" /* 在模块1 中包含模块1 的.h 文件 */
int a = 5; /* 在模块1 的.c 文件中定义int a */
/*module2 .c*/
#include "module1.h" /* 在模块2 中包含模块1 的.h 文件 */
/*module3 .c*/
#include "module1.h" /* 在模块3 中包含模块1 的.h 文件 */
|
|