title: map inside map in C++ . Pretty confusing?
body: <p>I am little confused here one map which has name myMap is a map inside map
   obviously on value side while the second map is a 
  very normal map of int vs char . 
  No in one case (which is myMap) it is allowing 
  duplicate keys (abnormal behaviour) while in another case it doesn't . </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;map&gt; 
  using namespace std;
  int main(void)
  { 
      map&lt;int, map&lt;int,char&gt; &gt; myMap;   // map inside map
      map&lt;int, char&gt; ourMap;            // normal map
  
      myMap[1][1] = 'A';
      myMap[1][2] = 'B';     // should overwrite  previous value
      myMap[2][1] = 'C';
      myMap[2][2] = 'D';     // should overwrite  previous value
  
      ourMap[1] = 'A';
      ourMap[1] = 'B';
  
      cout &lt;&lt; "[1][1] = " &lt;&lt; myMap[1][1] &lt;&lt; endl;
      cout &lt;&lt; "[1][2] = " &lt;&lt; myMap[1][2] &lt;&lt; endl;
      cout &lt;&lt; "[2][1] = " &lt;&lt; myMap[2][1] &lt;&lt; endl;
      cout &lt;&lt; "[2][2] = " &lt;&lt; myMap[2][2] &lt;&lt; endl;
  
      cout &lt;&lt; "ourMap[1] = " &lt;&lt; ourMap[1] &lt;&lt; endl;
  
      return 0;
  }
  // And here is the output . By the way I was anticipating , [1][2] = B , [2][2] = D &amp; ourMap[1] = B . But something else comes out . 
  
  OUTPUT :
  
  [1][1] = A
  [1][2] = B
  [2][1] = C
  [2][2] = D
  ourMap[1] = B
  </code></pre>
  
  <p>Is if we have map inside map does in C++ they start deviating from their normal behavior which is can't have duplicate keys 
  I am not able to figure it out how it is so . Can anyone tell me how it is so ? Extremely sorry if the question sounds funny ?  </p>
  
  <pre><code>My Question is for myMap 
  myMap[x][y] = something
  u can have only distinct value of x ?
  For normal map it is like that only . 
  </code></pre>