Link to my last topic:
C++ class forward declaration
Now main thing:
I decided to change all returned types to pointers to avoid memory leaks, but now I got:
27 C:\Dev-Cpp\Projektyyy\strategy\Tiles.h ISO C++ forbids declaration of `tile' with no type
27 C:\Dev-Cpp\Projektyyy\strategy\Tiles.h expected `;' before "tick"
Its only in base class, everything else is ok… Every function in tile class which return *tile has this error…
Some code:
class tile
{
public:
double health;
tile_type type;
*tile takeDamage(int ammount) {return this;};
*tile onDestroy() {return this;};
*tile onUse() {return this;};
*tile tick() {return this};
virtual void onCreate() {};
};
You’re missing a semi-colon on the return for
tick, and the*goes after the type when declaring pointers: