全局变量的用法
2008-04-10 02:16
246 查看
三个文件pc_main.h,modpc_com.h,modpc_com.cpp
modpc_com.h中的内容
extern char com_file_name[30];//for comminication
extern int g_mqid;//it is the message queue id
modpc_com.cpp中的内容
#include "modpc_com.h"
int g_mqid=5;
char com_file_name[30]="shared_file";
pc_main.cpp中的内容
#include "modpc_com.h"
int main()
{
cout<
modpc_com.h中的内容
extern char com_file_name[30];//for comminication
extern int g_mqid;//it is the message queue id
modpc_com.cpp中的内容
#include "modpc_com.h"
int g_mqid=5;
char com_file_name[30]="shared_file";
pc_main.cpp中的内容
#include "modpc_com.h"
int main()
{
cout<
相关文章推荐
- postgresql 类似 oracle sql%rowcount 用法 的全局变量
- c语言中static的用法,包括全局变量和局部变量用static修饰
- python基础 - global关键字及全局变量的用法
- extern修饰全局变量正确用法和链接错误的解决方法
- ActiveX控件中全局变量的一种用法
- [代码安全] 关于全局变量被修改以及volatile的用法
- c++多个源文件共用一个全局变量(extern 的用法)(
- qt中全局变量的用法
- Python全局变量用法实例分析
- cuda 全局device变量的用法
- Python教程之全局变量用法
- PHP中全局变量$_SERVER的详细用法
- ajax 异步调用把返回值赋给一个全局变量的用法,最主要的就是把async属性改为 false,
- extern用法,全局变量,全局函数与头文件(重复定义)
- C-C++中static的用法全局变量与局部变量
- 全局变量的用法
- 关于extern声明全局变量的用法
- c++作用域运算符用法(全局变量和局部变量)
- extern 用法,全局变量与头文件(重复定义)
- extern 用法,全局变量与头文件(重复定义)