Bat, Animal). There are two vtable pointers, one per inheritance hierarchy that virtually inherits Animal. In this example, one for Mammal and one for WingedAnimal. The object size has therefore increased by two pointers, but now there is only one Animal and no ambiguity. All objects of type Bat will use the same vpointers, but each Bat object will contain its own unique Animal object. If another class inherits from Mammal, such as Squirrel, then the vpointer in the Mammal part of Squirrel will generally be different to the vpointer in the Mammal part of Bat though they may happen to be the same if the Squirrel class be the same size as Bat. Additional Example of Several Ancestors This example to illustrates a case where base class A has a constructor variable msg and an additional ancestor E is derived from grandchild class D. A / \ B C \ / D | E Here, A must be constructed in both D and E. Further, inspection of the variable msg illustrates how class A becomes a direct base class of its deriving class, as opposed to a base class of any intermediate deriving classed between A and the final deriving class. The code below may be explored interactively here.#include <string> #include <iostream> class A { private: std::string _msg; public: A(std::string x): _msg(x) {} void test(){ std::cout<<"hello from A: "<<_msg <<"\n"; } }; // B,C inherit A virtually class B: virtual public A { public: B(std::string x):A("b"){} }; class C: virtual public A { public: C(std::string x):A("c"){} }; // Compile error when :A("c") is removed (since A's constructor is not called) //class C: virtual public A { public: C(std::string x){} }; //class C: virtual public A { public: C(std::string x){ A("c"); } }; // Same compile error // Since B, C inherit A virtually, A must be constructed in each child class D: public B,C { public: D(std::string x):A("d_a"),B("d_b"),C("d_c"){} }; class E: public D { public: E(std::string x):A("e_a"),D("e_d"){} }; // Compile error without constructing A //class D: public B,C { public: D(std::string x):B(x),C(x){} }; // Compile error without constructing A //class E: public D { public: E(std::string x):D(x){} }; int main(int argc, char ** argv){ D d("d"); d.test(); // hello from A: d_a E e("e"); e.test(); // hello from A: e_a } Pure Virtual Methods Suppose a pure virtual method is defined in the base class. If a deriving class