title: c++ multidimensional map: How to deference the 2nd key?
body: <p>My question is how to access that 2nd key (<code>int d</code>), if try to deference that 2nd key means it shows not found.</p>
  <p>Here's the code:</p>
  <pre><code>#include &lt;bits/stdc++.h&gt;
  
  using namespace std;
  
  struct mapp
  {
      int a;
      string s1;
  };
  
  int main()
  {
      map&lt;char, map&lt;int, struct mapp&gt;&gt; m2;
  
      char a = 'A';
      m2.insert(make_pair(a, map&lt;int, struct mapp&gt;()));
  
      int d = 3211;
      struct mapp m1;
      m1.s1 = &quot;flower&quot;;
      m1.a = 1551;
  
      m2[a].insert(make_pair(d, m1));
  
      cout &lt;&lt; m2.begin()-&gt;first &lt;&lt; endl;
      cout &lt;&lt; m2.begin()-&gt;second &lt;&lt; endl;
  
      map&lt;char, map&lt;int, struct mapp&gt;&gt;::interator it = m2.begin();
  
      // cout &lt;&lt; it-&gt;second &lt;&lt; endl;
      // map&lt;int, struct mapp&gt;::iterator pt = it.second-&gt;first;
  }
  </code></pre>