title: Constructor call in inherited classes
body: <p>Consider the following code:</p>
  
  <pre><code>class A {
  public:
      int a;
  };
  
  class B : public A {
  public:
      B() { std::cout &lt;&lt; "B[" &lt;&lt; a &lt;&lt; "]" &lt;&lt; std::endl; }
  };
  
  class C : public B {
  public:
      C() { std::cout &lt;&lt; "C[" &lt;&lt; a &lt;&lt; "]" &lt;&lt; std::endl; }
  };
  
  int main(int argc, char *argv[]) {
  
      B();
      std::cout &lt;&lt; std::endl;
      C();
  
  }
  </code></pre>
  
  <p>And its output -- program compiled with g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3:</p>
  
  <pre><code>B[0]
  
  B[-2097962768]
  C[-2097962768]
  </code></pre>
  
  <p>The only way I found to get the second call -- <code>C()</code> -- to have its values initialized was adding an explicit call to the constructors, like:</p>
  
  <pre><code>class B : public A {
  public:
      B() : A() { std::cout &lt;&lt; "B[" &lt;&lt; a &lt;&lt; "]" &lt;&lt; std::endl; }
  };
  
  class C : public B {
  public:
      C() : B() { std::cout &lt;&lt; "C[" &lt;&lt; a &lt;&lt; "]" &lt;&lt; std::endl; }
  };
  </code></pre>
  
  <p>Although I understand that calling the default constructor of each former class will initialize the values, I'm not able to see what is being called when nothing is specified.</p>
  
  <p>Isn't the default constructor what is called by default -- hence its handle?</p>