...
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 | ||
---|---|---|
| ||
enum { EOFEND_OF_FILE = -1 }; /* ... */ if (getchar() != EOFEND_OF_FILE) { /* ... */ } |
Exceptions
...