>Because it is an unsigned integer, shouldn't it only be able to store positive values
Yes, that's it exactly.
>Or is the -1 just like a catch all method, so that nothing else can possibly have that value?
If it helps, you can think of -1 in unsigned context as (0U - 1) . The effect is the same: subtracting 1 from 0 underflows and wraps around to the largest value for unsigned int.
Last edited by Narue; Sep 2nd, 2010 at 10:34 am.
Reputation Points: 6442
Solved Threads: 1391
Bad Cop
Offline 11,807 posts
since Sep 2004