From: boblq <[EMAIL PROTECTED]>
> He's wrong about the results of the bug- he says in C it overflows by
> going to an invalid index via underflow. In C, you'd use an unsigned
int
> (does Java have this?) thus wouldn't go to a negative index (although it
is
> still a bug, it won't crash the app. It may infinite loop). IF a
variable
> is supposed to be a loop index, it should always be unsigned in any
> language.
>
> Gabe
Why?
#include <stdio.h>
int main(int argc, char** argv) {
int i;
for(i=-10; i<10;i++) {
printf("%d\n", i);
}
return(0);
}
My bad. I meant to say array index, but I typed loop for some reason.
Gabe
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg