I know that using abstract base class to virtual member functions. When there are variable data in the abstract base class, I do not know how to write the constructor for derived constructor.
I have an exercise question that related to my problem.
output (should be like this):
I am an excellent dog and you may refer to me as Fido
I say woof
I am a cat and my name is Garfield
I say meow
"can not work"? I don't understand your question. Please explain.
I want to question an another detail of your code too:
Why do you create objects in main() like this? Dog foo( "squid", "Eeyore");
If all Doq objects are dogs, then why the user can give them arbitrary type?