An example Analysis of C++ 's Virtual function Table access to multiple inheritance
C++ on multiple inheritance of virtual function table access example analysis, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
The following is a routine for accessing virtual function tables with multiple inheritance:
The C++ compiler puts the address of the virtual function table in front of the instance object memory, which is actually a two-dimensional array.
If it is a single inheritance, then the virtual function table is actually an one-digit array.
# include
Using namespace std
Class Base1 {
Public:
Virtual void f () {cout