extern作用
1.在.c文件中声明一个全局变量,将该变量放在.h文件中并用extern声明,该全局变量可以被其他文件引用
2.函数前用extern声明,表示该函数在其他源文件中定义
在.c文件对应的头文件中声明了定义的函数,在其他.c文件中使用这些函数只要包含头文件即可,若不想包含头文件,可以在.c文件中声明该函数
extern作用
1.在.c文件中声明一个全局变量,将该变量放在.h文件中并用extern声明,该全局变量可以被其他文件引用
2.函数前用extern声明,表示该函数在其他源文件中定义
在.c文件对应的头文件中声明了定义的函数,在其他.c文件中使用这些函数只要包含头文件即可,若不想包含头文件,可以在.c文件中声明该函数