title: How do I iterate over a Constant Vector?
body: <p>I have a vector of Student which has a field name.</p>
  
  <p>I want to iterate over the vector.</p>
  
  <pre><code>void print(const vector&lt;Student&gt;&amp; students)
      {
      vector&lt;Student&gt;::iterator it;
      for(it = students.begin(); it &lt; students.end(); it++)
          {
              cout &lt;&lt; it-&gt;name &lt;&lt; endl;
          }
      }
  </code></pre>
  
  <p>This is apparently illegal in C++.</p>
  
  <p>Please help.</p>