4 ms·
Nope, it's still an index, after the comparison and before executing the code inside the loop, i is decreased by 1. Remember that a for loop does something lik
by Aldo_MX 12y ago
Nope, it's still an index, after the comparison and before executing the code inside the loop, i is decreased by 1.
Remember that a for loop does something like this behind the scenes:
size_t i = x.size();
while( i-- > 0 )
{
// your code which needs backwards iteration here
; // do nothing because there is no third statement
}