title: Get the key and values of map elements in a vector of maps from a constant iterator to the vector of maps
body: <p>I have a vector of maps containing strings .,i.e,</p>
  
  <pre><code>vector&lt; map &lt;string,string&gt; &gt; vectorOfMaps;
  
  vector&lt; map &lt;string,string&gt; &gt;::const_iterator itr =vectorOfMaps.begin();
  </code></pre>
  
  <p>vectorOfMaps is filled in another function and the caller function can access only the const_iterator itr. </p>
  
  <p>How do i access the key and its respective value of each map element in the vectorOfMaps?</p>
  
  <p>Any help appreciated:)</p>
  
  <p>EDIT: Got my solution.</p>
  
  <pre><code>map&lt;string,string&gt; myMap = (*itrVectorOfMaps);
  
  while(loop till the end element)
  {
      for(map&lt;string,string&gt;::iterator itM = myMap.begin();   
                                      itM != myMap.end(); itM++)
  
      {
          cout&lt;&lt;"Key="&lt;&lt;itM-&gt;first&lt;&lt;" =&gt; Value="&lt;&lt;itM-&gt;second&lt;&lt;endl;
      }
      itrVectorOfMaps++;
      myMap=(*itrVectorOfMaps);
  }
  </code></pre>