extern作用于变量。
首先明晰变量声明和定义的概念,还有定义声明和引用声明区别。
extern 修饰了变量后,此变量是引用声明,说明此变量在其它地方定义了。
通常做法是,要被其它模块引用的全局变量在.h文件里声明,在.c文件里定义,并冠于extern修饰符。
extern 冠于函数前,说明此函数在其它地方定义。
static 作用于文件作用域的变量说明其为内部链接,而不是静态存储周期。文件作用域的变量总是静态存储周期。
还是有点乱乱的。。。