Hi all,<br><br>I went looking for some info on when you should use size_t and when you should use unsigned, because I didn&#39;t really know the pros and cons of each approach...<br><br>Here is some reading:<br><a href="http://www.embedded.com/columns/programmingpointers/200900195">http://www.embedded.com/columns/programmingpointers/200900195</a><br>
<a href="http://www.embedded.com/columns/programmingpointers/201803576">http://www.embedded.com/columns/programmingpointers/201803576</a><br><a href="http://www.embedded.com/columns/programmingpointers/202404371">http://www.embedded.com/columns/programmingpointers/202404371</a><br>
<a href="http://www.embedded.com/showArticle.jhtml?articleID=204700432">http://www.embedded.com/showArticle.jhtml?articleID=204700432</a><br><br>it gives a good explanation of things<br><br>i think we should use size_t for things like size() and count_within_range() (even if for no other reason than to follow the STL) but i&#39;m still not clear on what we should use for the dimension size.&nbsp; to me, it doesn&#39;t seem to make any difference, which is why i think we should just use size_t for everything.<br>
<br>note that unsigned ints and size_ts are different on all platforms anyway... see this quote:<br><br>Unfortunately, this declaration for <font face="Courier" size="2"><b>memcpy</b></font>
comes up short on an I16LP32 processor (16-bits for int and 32-bits for
long and pointers), such as the first generation Motorola 68000. In
this case, the processor can copy objects larger than 65,536 bytes, but
this <font face="Courier" size="2"><b>memcpy</b></font> can&#39;t because parameter <font face="Courier" size="2"><b>n</b></font> can&#39;t handle values that large.<br><br>