title: c++ default constructor fails to initialize public variables?
body: <p>I have simple sample:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class parent {
  public:
      int i;
  };
  
  class child : public parent {
  public:
      int d;
  };
  
  int main() {
      child c;
      std::cout &lt;&lt; c.d &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p><a href="http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/cplr388.htm" rel="nofollow noreferrer">If you do not explicitly initialize a base class or member that has constructors by calling a constructor, the compiler automatically initializes the base class or member with a default constructor.</a> </p>
  
  <p>but all ints in c (<code>int d;</code> and <code>int i;</code>) are not initialized.</p>
  
  <p><img src="https://i.stack.imgur.com/e6x6C.jpg" alt="enter image description here"></p>
  
  <p>What is wrong with it? Or I do not see something obvios?</p>