...
Code Block | ||||
---|---|---|---|---|
| ||||
const float pi = 3.14159f; float degrees; float radians; /* ... */ radians = degrees * pi / 180; |
Exceptions
DCL00-EX1: It is acceptable to define valueless macros to serve as "inclusion guards." That is, the macro serves to control the multiple inclusion of header files, as in the following example:
Code Block |
---|
#ifndef SOME_HEADER_H
#define SOME_HEADER_H
... // content of header file
#endif
|
See PRE06-C. Enclose header files in an inclusion guard for more information on inclusion guards.
Risk Assessment
Failing to const
-qualify immutable objects can result in a constant being modified at runtime.
...