| High Integrity CPP Rule 5.12 | Declare for loop control variables within the for statement instead of using an existing variable. |
| (QA C++ 4230) |
| Justification |
This is a best practice rule. The main advantage is that the scope of the loop control variable is naturally limited to the for loop statement, using this construct achieves this minimum scope. |
| See also |