Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Avoided using reserved name in second CS.

...

In this compliant solution, the macro definition is replaced with an enumeration constant in compliance with DCL00-C. Const-qualify immutable objects. In addition, since EOF is a reserved macro defined in the <stdio.h> header, the compliant solution must also use a different indentifier in order to comply with DCL37-C. Do not use identifiers that are reserved for the implementation.

Code Block
bgColor#ccccff
enum { EOFEND_OF_FILE = -1 };
/* ... */
if (getchar() != EOFEND_OF_FILE) {
   /* ... */
}

Exceptions

...