6 ms·
A modern compiler would warn about the condition (ii >= 0) being always true. One correct way would be for (size_t i = len; i > 0; --i) { // use i-1 as
by mnaydin 8y ago
A modern compiler would warn about the condition (ii >= 0) being always true.
One correct way would be
for (size_t i = len; i > 0; --i) {
// use i-1 as the array index
}
or,
size_t i = len
while (i-- > 0) {
// use i as the array index
}