最佳答案:和c语言中定义全局变量一样。步骤如下: step 1: 在.c中定义要用到的变量比如:int a; step 2: 然后声明一个.h文件,在.h中声明:extern int a; step 3: 其他