Jump to content

Pointer (computer programming)

From Simple English Wikipedia, the free encyclopedia
Revision as of 16:15, 30 May 2015 by 68.54.216.63 (talk) (Undid revision 5144530 by 96.241.68.133 (talk))

In computer science, a pointer is a variable whose value is a location in the computer's memory.[1] If Rick stands in a room and points to his friend Sally, then Rick is 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.

References

  1. N. Datta, Computer Programming and Numerical Analysis (Hyderabad Universities Press, 2003), p. 465