...
In this compliant solution, the macro definition is replaced with an enumeration constant in compliance with recommendation 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 rule DCL37-C. Do not use identifiers that are reserved for the implementationdeclare or define a reserved identifier.
| Code Block | ||
|---|---|---|
| ||
enum { END_OF_FILE = -1 };
/* ... */
if (getchar() != END_OF_FILE) {
/* ... */
}
|
...