Chapter 12

Pointers

Many books will teach you that a pointer points to something, but this is not true:

A pointer is a variable that contains the memory address of another variable.

Where are pointers used?

Pointers provide a method to pass more than one piece of information into and out of a function (remember that a function can only return one value). They also provide means to pass arguments by reference to functions, rather than by value. And finally, pointers are more efficient when accessing arrays and dealing with strings.