Line60: The class Dog does not have an appropriate constructor.
You might do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class Dog : public Pet
{
public:
Dog(const string &name) : Pet{"dog", name}
{
}
...
};
...
int main()
{
Dog spot{"Spot"}; // The type is sent to Pet automatically
...
As the TheIdeasMan stated: It is preferable to use the keyword override:
1 2 3 4 5 6 7
class Dog : public Pet
{
public:
void whoAmI() const override; // override the describe() function
string speak() override;
};
Then you will see that speak() isn't correctly overwritten (missing const).