MISRA Discussion Forums

Full Version: 6.5 - variable kinds suitable for use as loop counter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Which of the following is a 'variable' and thus suitable for use as loop counter (and subject to the restrictions on loop-control-variables)?
  • local variable
  • static/global variable
  • class member variable
  • function parameter [code]void f(int x) { for (; x
All your examples are acceptable as loop counters