//Function.h
int a=0
class CFunction
{
void AddBlood();
};
报如下错误:
C:\Program Files\Microsoft Visual Studio\MyProjects\dro\Function.h(8) : error C2143: syntax error : missing ';' before '<class-head>'
C:\Program Files\Microsoft Visual Studio\MyProjects\dro\Function.h(8) : fatal error C1004: unexpected end of file found
Function.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\dro\Function.h(8) : error C2143: syntax error : missing ';' before '<class-head>'
C:\Program Files\Microsoft Visual Studio\MyProjects\dro\Function.h(8) : fatal error C1004: unexpected end of file found
Generating Code...
missing ';' before '<class-head>'这个的意思是在这之前缺少一个逗号
不是吧哥,要加也得是分号吧,我想在头文件定义个全局变量a该怎么弄呢,凡是包含这个头文件的cpp都可以用a。
追答额 是分号 。。。。你把全部代码发出来看看
关于第二个问题 这里你看看
http://aabbc1122.blog.163.com/blog/static/5704325720129213735293/