所以现在我只是想建立一个简单的类,但不知道为什么我会出错。这是我的头文件:
#define Mob
class Mob{
private:
int lvl;
float hp;
public:
Mob(int, float); //Error expected an identifier on the float
};
和它的cpp文件
#include "Mob.h"
Mob::Mob(int level, float health) // Error expected an identifier on the int and float
// and an Error: Expected a ; after the )
{
hp = health;
lvl = level;
}