Unsigned int >= 0 in a decrementing for-loop is a classic trap
for(i = length - 1; i < SIZE_MAX ; i--)
but it is completely valid.
for(i = 0; i < length; i++)
.. do something with (length - i - 1) ..
I've been much happier since I started writing all loops as incrementing loops. for (i = 0; i <= length; i++)
.. boy I sure hope length is not a max value ..
It's not about the incrementing vs. decrementing so much as the equality bounded loop on a value that could be a min/max value. Gets you every time.The only people I would not want to work with are ignoramuses and ironically, smart-asses. So you.