//h.h
int a=1;//const int a=1;//test1.cpp
#include "h.h"
main() {int b=a;}//test2.cpp
#include "h.h"
void f() {int c=a;}运行产生编译错误,若用const int a=1;则不会。为什么?
int a=1;//const int a=1;//test1.cpp
#include "h.h"
main() {int b=a;}//test2.cpp
#include "h.h"
void f() {int c=a;}运行产生编译错误,若用const int a=1;则不会。为什么?
解决方案 »
- 关于WINPCAP pcap_next_ex 函数获取的端口是什么类型?
- 对话框的类没在ClassView中显示
- 大侠进来看看,关于窗口背景的问题
- VC下如何改变picture控件的背景色
- 请教一个问题!!
- 如何获得HTML中,用“源文件”看不到的数据
- 如何用API在Static控件中显示图像?
- 举例:CBitmap创建一个100*100真彩图并显示(设所有像素点RGB(153,204,51))
- 急,如何才能将多个声音文件(.WAV)合成一个WAV文件???
- 奇怪的编译问题,谁能帮我解决啊!PPPP
- 在98中可以运行,为什么在xp中却不行,提示:show in the context
- 敬请高手指教VC模板问题!!
#define __YOURFILENAME__H__
int a=1;//const int a=1;#endif