title: Copying C++ Map into key and value vectors
body: <p>I have a <code>map</code> and I want the first column <code>i.e (*it).first</code> to be pushed back into a vector then <code>(*it)-&gt;second</code> to be pushed back into another vector </p>
  
  <p>Is this the best way to do it?</p>
  
  <pre><code>std::vector&lt;std::string&gt;test;
  for ( it=mymap.begin() ; it != mymap.end(); it++ )
  {
      test.push_back((*it).first);
  }
  </code></pre>
  
  <p>My other question is if i have a loop i.e
  how would I insert all the integers <code>i</code> into <code>(*it).first</code>?</p>
  
  <pre><code>for(int i = 0; i &lt; 10; i++)
  {
      // 1 - 10 will go in (*it).first
  }
  </code></pre>
  
  <p>I want to have some integers in <code>(*it).first</code> and have associated values in <code>(*it).second;</code></p>