title: Why does default constructor is called even when I am calling the parameterized constructor?
body: <p>I have a class and I am creating an object of it using parameterized constructor. During this time both parameterized  and default constructor has been called.</p>
  <p>Here is my snippet:</p>
  <pre><code>class student {
      string name;
      int age;
  public:
      student() {
          cout &lt;&lt; &quot;Calling the default constructor\n&quot;;
      }
      student(string name1, int age1) {
          cout &lt;&lt; &quot;Calling the parameterized const\n&quot;;
          name = name1;
          age = age1;
      }
      void print() {
          cout &lt;&lt; &quot; name : &quot; &lt;&lt; name &lt;&lt; &quot; age : &quot; &lt;&lt; age &lt;&lt; endl;
      }
  };
  
  int main()
  {
      map&lt;int, student&gt; students;
      students[0] = student(&quot;bob&quot;, 25);
      students[1] = student(&quot;raven&quot;, 30);
  
      for (map&lt;int, student&gt;::iterator it = students.begin(); it != students.end(); it++) {
          cout &lt;&lt; &quot;The key is : &quot; &lt;&lt; it-&gt;first ;
          it-&gt;second.print();
      }
      return 0;
  }
  </code></pre>
  <p>When I am executing this snippet, my output is coming as:</p>
  <p>Calling the parameterized const<br />
  Calling the default constructor<br />
  Calling the parameterized const<br />
  Calling the default constructor<br />
  The key is : 0 name : bob age : 25<br />
  The key is : 1 name : raven age : 30</p>
  <p>So, I want to understand, if I am calling the parameterized constructor, why default constructor has been called after the parameterized constructor?</p>