title: Order of calling constructors/destructors in inheritance
body: <p>A little question about creating objects. Say I have these two classes:</p>
  
  <pre><code>struct A{
      A(){cout &lt;&lt; "A() C-tor" &lt;&lt; endl;}
      ~A(){cout &lt;&lt; "~A() D-tor" &lt;&lt; endl;}
  };
  
  struct B : public A{
      B(){cout &lt;&lt; "B() C-tor" &lt;&lt; endl;}
      ~B(){cout &lt;&lt; "~B() D-tor" &lt;&lt; endl;}
  
      A a;
  };
  </code></pre>
  
  <p>and in main I create an instance of <code>B</code>: </p>
  
  <pre><code>int main(){
      B b;
  }
  </code></pre>
  
  <p><em>Note that <code>B</code> derives from <code>A</code> and also has a field of type <code>A</code>.</em></p>
  
  <p>I am trying to figure out the rules. I know that when constructing an object first calls its parent constructor, and vice versa when destructing.</p>
  
  <p>What about fields (<code>A a;</code> in this case)? When <code>B</code> is created, when will it call <code>A</code>'s constructor? I haven't defined an initialization list, is there some kind of a default list? And if there's no default list? And the same question about destructing.</p>