Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: inserted/changed some text around NCE/CS

...

Code Block
bgColor#FFcccc
if (a == b); {
  /* ... */
}

The statements in the apparent body of the if condition are always evaluated irrespective of the result of the condition expression.

Compliant Solution

It is likely, in this example, that the semicolon was accidentally insertedThis compliant solution eliminates the semicolon and ensures that the body of the if construct is executed only when the condition expression is true.

Code Block
bgColor#ccccff
if (a == b) {
  /* ... */
}

...