Pointer (computer programming)

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 Sa…

Pointer (computer programming)

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. Pointers do not take up much memory (RAM). Copying a pointer to a large object is faster than copying the large object itself because only the location needs to be copied, instead of the whole object.

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. This means that 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


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.