11 Feb
2005
11 Feb
'05
18:40
On Friday 11 February 2005 1:06 pm, Brad Bourn wrote:
On Friday 11 February 2005 10:54 am, Davi de Castro Reis wrote:
Notice that you also must say that the function returns an unsigned int, or it will be implicit returning an int and similar errors might occur.
Is there a way to ASSERT that the value is not negative? Yes and no. In your function, you are using all unsigned ints, which include the range from 0 to 2^32. In your code you can test for it: assert(i <= INT_MAX); This will assert for the range of values > INT_MAX, or 2147483648 -> 44294967295
--
Jerry Feldman