
一般情况下,a.h放的是函数或变量的声明,而a.c放的是定义如a.hexternintx;//声明一个整形的x变量externinttest();////声明一个test()函数而a.c中intx=100;//定义一个x变量inttest()//定义一个test()函数{}然后,其它的.c或#include"a.h"来使用a.c中的x和test()

一般情况下,a.h放的是函数或变量的声明,而a.c放的是定义如a.hexternintx;//声明一个整形的x变量externinttest();////声明一个test()函数而a.c中intx=100;//定义一个x变量inttest()//定义一个test()函数{}然后,其它的.c或#include"a.h"来使用a.c中的x和test()