What Isa Pointer

Cutting to the chase: a "pointer" is a machine address, unless the context makes it clear that the term is being used more metaphorically. The term "reference" is often, but not always, synonymous in both senses. CeePlusPlus is somewhat unusual in having both "references" and "pointers" in the language with somewhat different semantics. PassByReference, however, means something very specific that is not language-dependent or context-dependent.

What is a pointer? Everyone thinks they know; but it's a term with a lot of different meanings in ComputerScience, some of them rather loaded. Frequently, "pointer" is used as a dirty word--a low-level abstraction that no respectable code/programmer/system/language would touch with a ten-foot pole. Many creative alternate names for pointers have been coined over the years. For instance, early marketing literature and hype for JavaLanguage was full of silly claims like "Java has no pointers". Hogwash. While the object references of JavaLanguage may lack some of the nastier properties of CeeLanguage/CeePlusPlus pointers (PointerArithmetic for instance), they're still pointers--a fact betrayed by the presence of NullPointerException in the Java library. :) So, what is a pointer, exactly? At its basest level, it's a mechanism for doing indirection; for saying "that guy over there" without having to have that guy present. And, the pointer should provide efficient access/navigation to the object being referenced. (For example; both an IP address and a MAC address can uniquely identify a network node anywhere in the world. An IP address is a pointer of sorts; I can use it to try and connect with any computer anywhere. On the other hand, a MAC address is not; the only way I could use a MAC address to find another computer would be to query each computer in the world (or a database containing this information) to find which computer, if any, had the matching MAC address).

However, there are many varieties of pointers; each with their own features, foibles, and faults.

A pointer, depending on the context, may be:


Pointers rule. -- ThreeStarProgrammer
CategoryDefinition

EditText of this page (last edited August 14, 2010) or FindPage with title or text search