ACIUCFL - Avoid Complex Initialization or Update Clause in For Loops
When using the comma operator in the initialization or update clause of a for statement,
avoid the complexity of using more than three variables.
Wrong
i++, j++, k--, l += 2 ) {
// do something
}
Tip: If needed, use separate
statements before the for
loop (for the initialization clause)
or at the end of the loop (for the update clause).
Right
for ( i = 0, j=0, k=10; i < cnt;
i++, j++, k-- ) {
// do something
l += 2;
}