beggerking
Golden Member
- Jan 15, 2006
- 1,703
- 0
- 0
Originally posted by: nts
Originally posted by: beggerking
I'm a well-known programmer here which you obviously are not.
In C++ (OOP)
What is the virtual function pointer table (vtable)?
How does the vtable differ with virtual functions and pure virtual functions?
Where is this table stored, is it per instance?
Is there a difference in the construction of the table if you are initializing/constructing classes statically verses dynamically?
What happens to this table when using Multiple Inheritance (assuming virtual base classes)? What about multiple virtual inheritance (diamond inheritance pattern)?
Answer or PM me, Mr. Well known programmer.
EDIT: How about some ASM, very simple.
How do I read (get value of) the EIP register?
vtable = table contain pointers to vfunctions, to select which level of inheritance to call.
vfunction vs pure vfunction : pure vfunction has no implementation, hence abstract.
vtable differ in pure vfunction has no implementation yet, memory allocated dynamically.
new vtable added for each inheritance, diamond is problematic as it derives from 2 base classes that came from the same superclass. The vtable creates a cycle and hence overwriting baseclass function become ambiguous.
ASM .. umm. that I don't know..forgot about it mostly.