order of constructor - chain inheritance
<p>I run the program below  and after the first line of main I got this output:</p>

<blockquote>
  <p>1<br>
  6<br>
  1<br>
  6<br>
  13  </p>
</blockquote>

<p>Could anyone explain why it enters the constructors of <code>Grand</code> and <code>Father</code> twice?</p>

<pre><code>//base class 
class Grand{
public:
    Grand(){cout&lt;&lt;"1"&lt;&lt;endl;}
    Grand(const Grand &amp; g){cout&lt;&lt;"2"&lt;&lt;endl;}
    virtual ~Grand  (){cout&lt;&lt;"3"&lt;&lt;endl;}
    virtual void fun1(Grand g){cout&lt;&lt;"4"&lt;&lt;endl;}
    virtual void fun3(){cout&lt;&lt;"5"&lt;&lt;endl;}
private:
    int m_x;
    };



//derived class 
    class Father: public Grand{
    public:
        Father(){cout&lt;&lt;"6"&lt;&lt;endl;}
        Father(const Father &amp; f){cout&lt;&lt;"7"&lt;&lt;endl;}
        ~Father(){cout&lt;&lt;"8"&lt;&lt;endl;}
        void fun1(){cout&lt;&lt;"9"&lt;&lt;endl;}
        void fun2(Father &amp; f){
            cout&lt;&lt;"10";
            f.fun3();
        }
        void fun3(){
            cout&lt;&lt;"11"&lt;&lt;endl;
        }
        virtual void fun4(){
            cout&lt;&lt;"12"&lt;&lt;endl;
        }
    };


sing namespace std;

//derived class 
        class Son: public Father{
        public:
            Son(){cout&lt;&lt;"13"&lt;&lt;endl;}
            Son(const Son&amp; s){cout&lt;&lt;"14"&lt;&lt;endl;}
            ~Son(){cout&lt;&lt;"15"&lt;&lt;endl;}
            void fun3(){cout&lt;&lt;"16"&lt;&lt;endl;}
            virtual void fun5(Son&amp; s){
                cout&lt;&lt;"17"&lt;&lt;endl;
                s.fun1();
            }
        private:
            Father m_f;
            };

int main(){
Grand * pGrand= new Son; 
.........
.........
}
</code></pre>
