While solving diamond of death problem how many VTABLE will be created?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ferdinend
    New Member
    • Jul 2010
    • 7

    While solving diamond of death problem how many VTABLE will be created?

    class A {};
    class B : virtual public A {};
    class C : virtual public A {};
    class D : public B, public C {};


    In this how many VTABLE will be created? And for which classes this VTABLE will be created?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This sounds like a homework question.

    Assuming that is is homework, the hint is that a VTBL contains the addresses of the virtual functions either declared or inherited by the class.

    You should be able to get your answer from this.

    Comment

    Working...