title: Converting a size_t into an integer (c++)
body: <p>I've been trying to make a for loop that will iterate based off of the length of a network packet. In the API there exists a variable (size_t) by event.packet->dataLength. I want to iterate from 0 to event.packet->dataLength - 7 increasing i by 10 each time it iterates but I am having a world of trouble.</p>
  
  <p>I looked for solutions but have been unable to find anything useful. I tried converting the size_t to an unsigned int and doing the arithmetic with that but unfortunately it didn't work. Basically all I want is this:</p>
  
  <pre><code>for (int i = 0; i &lt; event.packet-&gt;dataLength - 7; i+=10) { }
  </code></pre>
  
  <p>Though every time I do something like this or attempt at my conversions the i &lt; # part is a huge number. They gave a printf statement in a tutorial for the API which used "%u" to print the actual number however when I convert it to an unsigned int it is still incorrect. I'm not sure where to go from here. Any help would be greatly appreciated :)</p>