Jump to content

Pointer (computer programming)

From Simple English Wikipedia, the free encyclopedia
Revision as of 14:46, 15 September 2014 by 206.212.17.248 (talk) (Described pointers and their use in linked lists.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In computer science, a pointer is an object whose value is the location of another object in the computer's memory. If Rick stands in a room and points to his friend Sally, then Rick is like a pointer whose value is Sally's location. A programmer must dereference the pointer to retrieve the object it points to.

Uses of Pointers

Pointers are used in linked lists. Each record of a linked list has a pointer to the next record. These pointers chain the records together. Thus, the records in a linked list can be sorted and arranged by changing their pointers.