I declared a variable cnt of ubyte first as part of the for loop
initialiser to 3, then found it odd that the loop went infinite.

I ran through the debugger and first time through it correctly
decrements value and cnt = 2, the next time round it went to -1, this
did not happen when I declared the cnt to be an uint

I then initialised cnt outside the loop and got the same behaviour

The code was
for(ubyte cnt = 3; cnt > 0; --cnt)
{
    ...
    code here
}

Reply via email to