another stupid c bug. (endless for loop)

From: Skybuck Flying (nospam_at_hotmail.com)
Date: 08/27/04


Date: Fri, 27 Aug 2004 18:43:23 +0200

I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

Surprise Surprise... C sucks at it... once again :D lol... C is such a bad
language it amazes me everytime :D

Just look at this ***:

unsigned short int i;

// I set i to a large value so one can see the wrap occuring.
 for (i=65500; i<65536; i++)
{
   // endless loop
}

 for (i=65500; i<=65535; i++)
{
   // endless loop
}

 for (i=65500; i<65536; ++i)
{
   // endless loop
}

 for (i=65500; i<=65535; ++i)
{
   // endless loop
}

There... I tried out all possibilities...

The original loop was something like:
 for (i=0; i<=65535; i++)
{
   // endless loop
}

Ha ! C SUCKS BALLS

Man... just a simple pascal loop and I would have been done already.

var
    i : word;
for i:=0 to 65535 do
begin

end;

Lol... I don't even have to test that code....

I know 100% sure it will work just fine ;)

With C one never knows lol hahahahaha.

NOW GO *** YOURSELF hahahahahaha


Quantcast