title: C++ Default constructor
body: <p>Given the following code:</p>
  
  <pre><code>class temp
  {
  public:
      string str;
      int num;
  };
  
  int main()
  {
      temp temp1;
      temp temp2 = temp();
  
      cout &lt;&lt; temp1.str &lt;&lt; endl; //Print ""
      cout &lt;&lt; temp2.str &lt;&lt; endl; //Print ""
  
      cout &lt;&lt; temp1.num &lt;&lt; endl; //Print a rand num
      cout &lt;&lt; temp2.num &lt;&lt; endl; //Print 0
  }
  </code></pre>
  
  <p>What is the different between these two?&mdash;</p>
  
  <pre><code>temp temp1;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>temp temp2 = temp();
  </code></pre>