title: How to define a map iterator in c++ using map name and printing map<int.class>
body: <p>Firstly, can I declare a map iterator for the following class</p>
  
  <pre><code>class obj {
  public:
      map&lt;int,double&gt; m1;
  };
  
  map&lt;int,obj&gt; m;
  </code></pre>
  
  <p>as <code>m::iterator it = m.begin();</code> or should I it declare as <code>map&lt;int,obj&gt;::iterator it = m.begin();</code></p>
  
  <p>Secondly, I want to print the map <code>m</code>.
  How can I print the above given map that has its value data type as class and that class contains another map?</p>