
336 ◾ Appendix A
A.2 INAPPROPRIATE USE OF POINTERS
Example A3 illustrates illegal and unwise manipulations of pointers.
Figure A3 sketches the corresponding memory allocation. A pointer may
not hold the address of a constant value. Nor may a pointer point to a literal
value. Why? ere is no program memory associated with constants or lit-
erals. e cross-through statements in Example A3 indicate compilation
errors. More problematic are statements that compile but have unknown
eect because the pointer variable may or may not contain a valid address.
Example A3: Danger of the Uninitialized: C++
// C++ code: missing and illegal initialization ...