What the inheritating class structure looks like?
<p>All:</p>

<p>When I study polymorphism in C++, I find a small example here:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
class Base{
public:
virtual void f(float x){cout&lt;&lt;"Base::f(float)"&lt;&lt;x&lt;&lt;endl;}
        void g(float x){cout&lt;&lt;"Base::g(float)"&lt;&lt;x&lt;&lt;endl;}
        void h(float x){cout&lt;&lt;"Base::h(float)"&lt;&lt;x&lt;&lt;endl;}
};

class Derived:public Base{
public:
virtual void f(float x){cout&lt;&lt;"Derived::f(float)"&lt;&lt;x&lt;&lt;endl;}
        void g(int x){cout&lt;&lt;"Derived::g(int)"&lt;&lt;x&lt;&lt;endl;}
        void h(float x){cout&lt;&lt;"Derived::h(float)"&lt;&lt;x&lt;&lt;endl;}
};
int main(void){
  Derived d;
  Base *pb=&amp;d;
  Derived *pd=&amp;d;

  //Good:behavior depends solely on type of the object
  pb-&gt;f(3.14f);     //Derived::f(float)3.14
  pd-&gt;f(3.14f);     //Derived::f(float)3.14

  //Bad:behavior depends on type of the pointer
  pb-&gt;g(3.14f);     //Base::g(float)3.14
  pd-&gt;g(3.14f);     //Derived::g(int)3(surprise!)

  //Bad:behavior depends on type of the pointer
  pb-&gt;h(3.14f);     //Base::h(float)3.14(surprise!)
  pd-&gt;h(3.14f);     //Derived::h(float)3.14


  return 0;
}
</code></pre>

<p>After study virtual function, I think I got the idea how the polymorph work, but there are still some question in this code, I do not want bother someone explaining how this code work, I only need someone who can show me detail inside the Derived class( no need for too much detail, just show how the method function pointer(or index) arranged in Vtable and structure for those are not virtual inheritated one). </p>

<p>From pb->h(3.14f);     //Base::h(float)3.14(surprise!)
I guess there should be several vtables, am I right?</p>

<p>Thanks! </p>
