全局变量的定义如wpmsoft所讲! 全局函数的定义在一个CPP中书写函数体,在一个.h中写函数的原型声明!使用该函数的CPP都要include该头文件! /////////////////// // common.h #ifndef __COMMON__H #define __COMMON__H extern int tt; void MyFunc1(void);#endif /////////////// // common.cpp // 不必#include "common.h" int tt;//只在本文件中定义;