appear at the same offset for all type-compatible classes. Thus, fetching the method's address from a given offset into a virtual method table will get the method corresponding to the object's actual class. The C++ standards do not mandate exactly how dynamic dispatch must be implemented, but compilers generally use minor variations on the same basic model. Typically, the compiler creates a separate virtual method table for each class. When an object is created, a pointer to this table, called the virtual table pointer, vpointer or VPTR, is added as a hidden member of this object. As such, the compiler must also generate "hidden" code in the constructors of each class to initialize a new object's virtual table pointer to the address of its class's virtual method table. Many compilers place the virtual table pointer as the last member of the object; other compilers place it as the first; portable source code works either way. For example, g++ previously placed the pointer at the end of the object. Example Consider the following class declarations in C++ syntax: class B1 { public: virtual ~B1() {} void fnonvirtual() {} virtual void f1() {} int int_in_b1; }; class B2 { public: virtual ~B2() {} virtual void f2() {} int int_in_b2; }; used to derive the following class: class D : public B1, public B2 { public: void d() {} void f2() override {} int int_in_d; }; and the following piece of C++ code: B2 *b2 = new B2(); D *d = new D(); g++ 3.4.6 from GCC produces the following 32-bit memory layout for the object b2: b2: +0: pointer to virtual method table of B2 +4: value of int_in_b2 virtual method table of B2: +0: B2::f2() and the following memory layout for the object d: d: +0: pointer to virtual method table of D (for B1) +4: value of int_in_b1 +8: pointer to virtual method table of D (for B2) +12: value of int_in_b2 +16: value of int_in_d Total size: 20 Bytes. virtual method table of D (for B1): +0: B1::f1() // B1::f1() is not overridden virtual method table of D (for B2): +0: D::f2() // B2::f2() is overridden by D::f2() // The location of B2::f2 is not in the virtual method table for D Note that those functions not carrying the keyword virtual in their declaration (such as fnonvirtual() and d()) do not generally appear in the virtual method table. There