title: Error in iterator declaration in a for loop
body: <pre><code>void catchlabel()
  {
      if(vecs.empty())
          return;
      else
      {
      cout &lt;&lt; "The Sizeof the Vector is: " &lt;&lt; vecs.size() &lt;&lt; endl; 
      cout &lt;&lt; "Currently Stored Labels: " &lt;&lt; endl;
      /* Error 1 */
  for ( int i = 1, vector&lt;string&gt;::iterator it = vecs.begin(); it != vecs.end(); ++it , i++) 
               cout &lt;&lt; i &lt;&lt; ". "&lt;&lt; *it &lt;&lt; endl;
              cout &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>I get the following error for:</p>
  
  <p>1> error C2146: syntax error : missing ',' before identifier 'it'</p>
  
  <p>How to fix this?</p>