title: C++ Loop through Map
body: <p>I want to iterate through each element in the <code>map&lt;string, int&gt;</code> without knowing any of its string-int values or keys.</p>
  
  <p>What I have so far:</p>
  
  <pre><code>void output(map&lt;string, int&gt; table)
  {
         map&lt;string, int&gt;::iterator it;
         for (it = table.begin(); it != table.end(); it++)
         {
              //How do I access each element?  
         }
  }
  </code></pre>