【发布时间】:2011-07-10 01:49:36
【问题描述】:
我正在尝试创建一个具有五个参数的构造函数的类。构造函数唯一要做的就是将所有参数传递给超类构造函数。这个类没有任何额外的变量:它的唯一目的是改变 getClassType 虚函数的实现。出于某种原因,此标头在构造函数中给出了“'*'标记之前的预期主表达式”,并且它还在同一行中给出了四个“'int'之前的预期主表达式”:
#ifndef SUELO_H
#define SUELO_H
#include "plataforma.h"
#include "enums.h"
#include "object.h"
#include "Box2D/Box2D.h"
class Suelo : public Plataforma
{
public:
Suelo(b2World *world,int x,int y,int w,int h) : Plataforma(b2World* world,int x,int y,int w,int h){}
virtual ~Suelo();
virtual ClassType getClassType();
protected:
private:
};
#endif // SUELO_H
我认为这些错误是由一些拼写错误引起的,但我检查了教程和谷歌,我没有发现任何错误,所以我被卡住了。
【问题讨论】:
标签: c++ constructor compiler-errors