P
Phil Carmody
It's typical C to use 'int' unless something else is needed.
Sloppiness is typical too.
Possibly without exception, when the standard library provides an
interface for a function that implies operating over an array of
objects, the number of objects is specified as an unsigned type.
The sanest internal behaviour for those functions is to have the
same unsigned type as the index controlling the loop. So there
are plenty of very common examples of at least implicit unsigned
counters.
It's probably an error if the counter comes in negative [or negative if
it were signed if it's unsigned]
can't parse that, sorry
, but maybe running zero times is fine.
beg = 8;
end = 6;
for (j = beg; j < end; j++)
...
Ewwwww, integer overflow. Were you attemting to put forward a case
*for* the use of unsigned integers, as at least you'd know that you'd
wrap.
Phil
--
Pics or it didn't happen.I'd argue that there is much evidence for the existence of a God.
-- Tom (/. uid 822)