title: C++ for-loop - size_type vs. size_t
body: <p>In the <code>C++ Primer</code> book, Chapter (3), there is the following for-loop that resets the elements in the vector to zero.</p>
  
  <pre><code>for (vector&lt;int&gt;::size_type ix = 0; ix ! = ivec.size(); ++ix)
  ivec[ix] = 0;
  </code></pre>
  
  <p>Why is it using <code>vector&lt;int&gt;::size_type ix = 0</code>? Cannot we say <code>int ix = 0</code>? What is the benefit of using the first form on the the second?</p>
  
  <p>Thanks.</p>