title: Memory allocation and working of std::map in c++
body: <p>I was reading about the map c++ dictionary implementation. I read a code somewhere on the net which had the following lines.</p>
  
  <pre><code>map &lt;int, int&gt; A[100005];
  A[1][2]=1;
  </code></pre>
  
  <p>please can you explain how is memory allocated. Is it in the same way as a 2-D array or it increases dynamically while we are inserting.</p>
  
  <p>And how does the insertion in the map takes place given the second line of code.</p>