摘要: 头文件:state.h源文件:state.cpp其它源文件:t1.cppt2.cppt3.cpp,这些源文件都包含头文件state.h。需要定义一个全局变量供这些源文件中使用:方法如下1、在 state.h声明全局变量: extern int a;2、在state.cpp中定义该全局变量:int a... 阅读全文
posted @ 2015-04-16 16:45 龙泽一狼 阅读(122) 评论(0) 推荐(0) 编辑