11 Feb
2005
11 Feb
'05
18:04
On Friday 11 February 2005 10:54 am, Davi de Castro Reis wrote:
When you pass the -1 to the function, it will be implicit cast to an unsigned int (2^32 in this case). This is a consequence of the design of your function. When you say func(unsinged int foo) you are saying that this function only receives unsigned integers. When you pass a signed integer to it, it will break, since you are violating the signature. You must assure that foo is unsigned or change your function:
right, but if I debug out the value of foo, it is still negative (-1) ah, I think I just answered my own question. When I debug the unsigned int, the debug function expects an int and so converts it back to the -1..... I understand now. Thanks B-)