title: Two ways of calling default constructor
body: <p>I have the following code: </p>
  
  <pre><code>struct B
  {
   //B() {}
   int x;
   int y;
  };
  
  void print(const B &amp;b) 
  {
   std::cout&lt;&lt;"x:"&lt;&lt;b.x&lt;&lt;std::endl;
   std::cout&lt;&lt;"y:"&lt;&lt;b.y&lt;&lt;std::endl;
   std::cout&lt;&lt;"--------"&lt;&lt;std::endl;
  }
  
  int main()
  {
   B b1 = B(); //init1
   B b2; //init2
  
   print(b1);
   print(b2);
  
   return 0;
  }
  </code></pre>
  
  <p>When I start program (vs2008, debug) I have the following output:</p>
  
  <pre><code>x:0
  y:0
  --------
  x:-858993460
  y:-858993460
  --------
  </code></pre>
  
  <p>As you can see b1.x and b1.y have 0 value. why? What's difference between init1 and init2?</p>
  
  <p>When I uncomment B constructor I have the following output:</p>
  
  <pre><code>x:-858993460
  y:-858993460
  --------
  x:-858993460
  y:-858993460
  --------
  </code></pre>
  
  <p>Can somebody explain the reason of this behaviour?
  Tnx in advance.</p>