Can anyone explain the output of the following code?
#include #include class Animal { public: Animal(const std::string &
Just tried it. Add the const to the Cow class and it will work.
const
i.e. virtual void printMessage () const for both classes.
virtual void printMessage () const