Borland C++ Builder: The Complete Reference
however, be used in other types of expressions. A const variable will receive its value
either from an explicit initialization or by some hardware-dependent means. For
example, this gives count the value of 100:
variable's address can be passed to the clock routine of the operating system and used
to hold the time of the system. In this situation, the contents of the variable are altered
without any explicit assignment statements in the program. This is important because
C automatically optimizes certain expressions by making the assumption that the
content of a variable is unchanging inside that expression. Also, some optimizations
may change the order of evaluation of an expression during the compilation process.
The volatile modifier prevents these changes from occurring.
declaration is precisely what you would want to prevent any possibility of accidental
side effects:
value that can be modified by the program. All variables must be declared before they
are used. The general form of a declaration is shown here: