The choice of a point of view is the initial act of culture.
There are things, and there are pointers to things (Figure 15-1).
Figure 15-1. A thing and a pointer to a thing
Things can come in any size; some may be big, some may be small. Pointers come in only one size (relatively small).
Throughout this book I use a box to represent a thing. The box may be large or small, but things are always a box. Pointers are represented by arrows.
Most novice programmers get pointers and their contents confused.
To limit this problem, all pointer variables in this book end with the
_ptr . You probably want to follow this convention in your own
programs. Although not as common as it should be, this notation is
Figure 15-1 shows one
thing: a variable named
name of the variable is written on the box that represents it. This
variable contains the value 6. The actual address of this variable is 0x1000. C++
automatically assigns an address to each variable at compile time. The
actual addresses differ from machine to machine. Most of the time you
don't have to worry about variable addresses, as the compiler takes care
of that detail. (After all, you've gotten through 14 chapters of
programming without knowing anything about addresses.)
The pointer (
to the variable
thing. Pointers are
also called address ...