title: why there are two virtual destructor in the virtual table and where is address of the non-virtual function （gcc4.6.3）
body: <p>I implemented a simple test to check the memory rank of Derived class, so I find there are two virtual destructor address in the virtual table of Derive class. Can someone explain it to me?</p>
  
  <h2>Code:</h2>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;ostream&gt;
  #include&lt;cstdio&gt;
  using namespace std;
  
  class Base1
  {
      public:
          Base1():a(1){}
          virtual ~Base1()
          {
              cout &lt;&lt; "~Base1"  &lt;&lt; endl;
          }
          int a;
          virtual void print()
          {
              cout &lt;&lt; "I am base 1!" &lt;&lt; endl;
          }
  };
  
  class Base2
  {
      public:
          Base2():b(2){}
          virtual ~Base2(){
              cout &lt;&lt; "~Base2" &lt;&lt; endl;
          }
          int b;
          virtual void print()
          {
              cout &lt;&lt; "I am base 2!" &lt;&lt; endl;
          }
  };
  
  class Derive : public Base1, public Base2
  {
      public:
          Derive():c(3){}
          virtual ~Derive(){
              cout &lt;&lt; "~Derive" &lt;&lt; endl;
          }
          int c;
          virtual void print()
          {
              cout &lt;&lt; "I am Derive!!" &lt;&lt; endl;
          }
          void prints()
          {
              cout &lt;&lt; "I am not virtual!!" &lt;&lt; endl;
          }
  };
  
  int main()
  {
      typedef void (*Func) (void);
      Derive *d = new Derive();
      int **p = (int **)(d);
      Func f = (Func)(p[0][0]);
      //int s = (int)(*(p + 3));
      Func f2 = (Func)(p[0][1]);
      //cout &lt;&lt; p &lt;&lt; endl;
      //cout &lt;&lt; s &lt;&lt; endl;
      f();
      //cout.flush();
      f2();
      //f();
      return 0;
  }
  </code></pre>
  
  <p>I find the </p>
  
  <pre><code>f() and f2()
  </code></pre>
  
  <p>The result is as follow：</p>
  
  <pre><code>~Derive
  ~Base2
  ~Base1
  ~Derive
  ~Base2
  ~Base1
  </code></pre>
  
  <p>are destructors of derived class. Why are there two?</p>
  
  <p>And I have another question: Where is the address of the non-virtual member function? I find the non-virtual function address does not exist in the memory of the derived class. Where is it?</p>