When you call the constructor on a derived class, what happens is this:
- the base object gets constructed first
- any variables in the initialisation list get initialised
- the body of the (derived) constructor is executed
If you do not specify a different constructor, the default constructor will be used for (1). You are getting a compiler error because you have no default constructor.
To specify a different constructor, do something like this:
Ogre::Ogre(int health, int lAttack, int fAttack, int damage) : Character (health, lAttack, fAttack, damage)
{
// body of constructor
}
Then the instance of the constructor that matches those parameters will be called instead. Since you have defined that, you won't get an error.
As for the error on the destructors, firstly, as others have said, you can't override the destructor without declaring it in the class. So you could add ~Ogre()
to your class definition. However, you're not currently doing anything in your destructor body, so why are you redefining it at all? Just leave it as the default destructor.