title: what is the difference between using insert function when using std::map.insert("xyz") or just map[ind]="xyz"
body: <p>In the following example what is the pros and cons of using 1) versus 2).  Is there any memory allocation benefits, any benefits as far as not running out of space?</p>
  
  <pre><code>map &lt;  int, string&gt; Employees;  
  
  
  
    // 1) Assignment using array index notation  
  
     Employees[5234] = "Mike C.";  
  
    // 2) Assignment using member function insert() and STL pair  
  
      Employees.insert(std::pair&lt;int, * char&gt;(1923,"David D."));  
  </code></pre>