Re: Are these c'tors legal or dangerous?

Originally Posted by
John E
Suppose you have a 3 class hierarchy - base.... derived1 (derived from base) and derived2 (derived from derived1). Should you put virtual functions in base and derived1 or is it only necessary in the base class?
In general, the base class should contain the initial virtual function declarations and definitions.
Perhaps pure virtual if it is an abstract class, in which case no definition is given.
Then, each derived class should override those virtual functions which it inherits from the base so that polymorphism can be used.
Please rate my post if you felt it was helpful