C
christian.bau
jacob said:Ian said:jacob navia wrote:
Richard Tobin wrote:
Why would you want a signed loop index for a zero to unsigned range?
I may sound pedantic, but keeping signed and unsigned quantities apart
avoids nasty bugs.
for (i = strlen (s) - 1; i >= 0; --i) ...
loops through all characters in a string in reverse order, as long as
the length of s is not excessive, if i is a signed 32 bit or longer
integer. Now write that with an unsigned type without any convoluted
code.