title: For Loop Exit Condition (size_t vs. int)
body: <p>When I put the following in my program:</p>
  
  <pre><code>for (size_t i = VectorOfStructs.size()-1; i &gt; 0; i--)
  </code></pre>
  
  <p>It works correctly but does "i" will never equal 0.
   So, I cannot access the first element (VectorOfStructs[0]).</p>
  
  <p>If I change it to:</p>
  
  <pre><code>for (size_t i = VectorOfStructs.size()-1; i &gt; -1; i--)
  </code></pre>
  
  <p>The program doesn't even enter the for loop! But, if I change it to the following:</p>
  
  <pre><code>for (int i = VectorOfStructs.size()-1; i &gt; -1; i--)
  </code></pre>
  
  <p>It works exactly as I want it to (Iterates through all the elements).</p>
  
  <p><strong>So, my questions are:</strong></p>
  
  <p><strong>(A) Why does the 2nd code snippet fail to execute?</strong></p>
  
  <p><strong>(B) Why does the 3rd code snippet execute accordingly while the 2nd doesn't?</strong></p>
  
  <p>Any insight would be greatly appreciated!</p>