title: Printing Associative Array in C++
body: <p>I have declared an associative array and now want to print it:</p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;string&gt;
  #include &lt;cstdio&gt;
  
  using namespace std;
  
  int main() {
      map&lt;string, int&gt; m;
  
      m["Peter"] = 4;
      m["John"] = 3;
      m["Katie"] = 3;
  
      map&lt;string, int&gt;::iterator curr,end;
  
      for(curr = m.begin(), end = m.end(); curr != end; curr++) {
          printf("%s : %i\n", curr-&gt;first, curr-&gt;second);
      }
      return 0;
  }
  </code></pre>
  
  <p>I'm getting an error from my compiler:</p>
  
  <pre><code>main.cpp: In function ‘int main()’:
  main.cpp:24: warning: cannot pass objects of non-POD type ‘const struct std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;’ through ‘...’; call will abort at runtime
  </code></pre>
  
  <p>And surprise suprise - it's true - call aborts at runtime...</p>
  
  <p>But I don't know why... What should I fix? What exactly mean "through ‘...’" ?</p>