Pointers

A pointer is piece of data that contains the information about how to access another piece of data. One may say that a pointer is the abstract address of a variable. However, the implementation of pointer has no direct link with the physical memory address of the variable.

When a pointer p contains the address of a variable x, we say that p points to x. If two pointers have equal values, they would point to the same variable. This makes it possible for different variables to share data, and create dependencies among different modules of programs.

Pointer is supported in a manner so that programmers can build intricate data structures when necessary, and yet are not forced to use pointers for normal tasks. Pointers are safe since there is no way to do pointer arithmetic, and invalid pointers are detected by the interpreter to avoid interpreter failure. More importantly, since it is not necessary to use pointers all the time, implicit program behaviors can be minimized.



Subsections

oz 2009-12-22