为什么我会在一个声明中获得多种类型?
这是我的课程:
#include <iostream>
#include "gameobject.h"
#include "IXmlAssigner.h"
#ifndef CHARACTER_H
#define CHARACTER_H
//line 7...
enum Race {HUMAN, DARK_ELF};
enum Gender {MALE, FEMALE};
class Character : public GameEntity, protected IXmlAssigner
{
public:
Character();
Character(std::string xmlCharID);
~Character();
int get_id();
std::string get_name();
Race get_race();
Gender get_gender();
virtual void assign_xml(std::string xmlCharID);
protected:
int char_id;
static int char_count;
std::string name;
Race race;
Gender gender;
};
#endif // CHARACTER_H
在第 7 行,它指出“一个声明中有多种类型”错误。这是为什么呢?我可以做些什么来改变它吗?
Here is my class:
#include <iostream>
#include "gameobject.h"
#include "IXmlAssigner.h"
#ifndef CHARACTER_H
#define CHARACTER_H
//line 7...
enum Race {HUMAN, DARK_ELF};
enum Gender {MALE, FEMALE};
class Character : public GameEntity, protected IXmlAssigner
{
public:
Character();
Character(std::string xmlCharID);
~Character();
int get_id();
std::string get_name();
Race get_race();
Gender get_gender();
virtual void assign_xml(std::string xmlCharID);
protected:
int char_id;
static int char_count;
std::string name;
Race race;
Gender gender;
};
#endif // CHARACTER_H
On line 7, it states the "multiple types in one declaration" error. Why is this? Is there anything I can do to change it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您很可能在这些标头之一末尾的类或结构声明末尾缺少
;
。Most likely you're missing a
;
at the end of a class or structure declaration at the end of one of these headers.