Pointer (computer programming)

Pointer (computer programming)

In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.

Comment
enIn computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.
Date
enApril 2018
9 June 2019
Depiction
Pointers.svg
Has abstract
enIn computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture. Using pointers significantly improves performance for repetitive operations, like traversing iterable data structures (e.g. strings, lookup tables, control tables and tree structures). In particular, it is often much cheaper in time and space to copy and dereference pointers than it is to copy and access the data to which the pointers point. Pointers are also used to hold the addresses of entry points for called subroutines in procedural programming and for run-time linking to dynamic link libraries (DLLs). In object-oriented programming, pointers to functions are used for binding methods, often using virtual method tables. A pointer is a simple, more concrete implementation of the more abstract reference data type. Several languages, especially low-level languages, support some type of pointer, although some have more restrictions on their use than others. While "pointer" has been used to refer to references in general, it more properly applies to data structures whose interface explicitly allows the pointer to be manipulated (arithmetically via pointer arithmetic) as a memory address, as opposed to a magic cookie or capability which does not allow such. Because pointers allow both protected and unprotected access to memory addresses, there are risks associated with using them, particularly in the latter case. Primitive pointers are often stored in a format similar to an integer; however, attempting to dereference or "look up" such a pointer whose value is not a valid memory address could cause a program to crash (or contain invalid data). To alleviate this potential problem, as a matter of type safety, pointers are considered a separate type parameterized by the type of data they point to, even if the underlying representation is an integer. Other measures may also be taken (such as validation & bounds checking), to verify that the pointer variable contains a value that is both a valid memory address and within the numerical range that the processor is capable of addressing.
Hypernym
Language
Is primary topic of
Pointer (computer programming)
Label
enPointer (computer programming)
Link from a Wikipage to an external page
www.researchgate.net/publication/220424487_PLI_list_processing
cdecl.org
0pointer.de/
cslibrary.stanford.edu/
overiq.com/c-programming-101/pointer-basics-in-c/
www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
publications.gbdirect.co.uk/c_book/chapter5/pointers.html
www.onlinecomputerteacher.net/pointers-in-c.html
web.archive.org/web/20190609120644/http:/www.onlinecomputerteacher.net/pointers-in-c.html
Link from a Wikipage to another Wikipage
.NET Framework
Abstraction (computer science)
Access type
Ada (programming language)
Address constant
Address programming language
Anti-pattern
Application programming interface
Argv
Array data structure
Array data type
ASCII
Assembly language
Assignment (computer science)
BASIC
Binary numeral system
BIOS
Bit shift
Bitwise operation
BlitzMax
Bounded pointer
Bounds checking
Buffer overflow
Byte
Byte addressing
Byte code
C (programming language)
C (Programming Language)
C++
C++11
C++ Standard Library
C99
Capability-based security
Car and cdr
Category:American inventions
Category:Articles with example C code
Category:Data types
Category:Primitive types
COBOL
Collection (abstract data type)
Color Graphics Adapter
Computer architecture
Computer hardware
Computer memory
Computer multitasking
Computer performance
Computer science
Cons
Control table
CPU architecture
Crash (computing)
C Sharp (programming language)
Cyclone programming language
D (programming language)
Dangling pointer
Dangling pointers
Data structure
Data structure alignment
Data structures
Datatype
Data type
Data validation and reconciliation
Delphi (programming language)
Dereference operator
Device register
Donald Knuth
Dynamic link library
Dynamic memory allocation
Eiffel (programming language)
Embarcadero Delphi
Endianness
Exception handling
EXEC CICS
Fat pointer
File:Pointers.svg
Flat address space
Floating-point number
Fortran
Free()
FreeBASIC
Free Pascal
Functional programming language
Function pointer
Garbage collection (computer science)
General protection fault
General purpose register
GNU Compiler Collection
Go (programming language)
Harold Lawson
Haskell (programming language)
Hazard pointer
Hexadecimal
I
IEEE
Imperative languages
Imperative programming
Instruction set simulator
Integer
Intel 80286
International Organization for Standardization
Iterator
Java (programming language)
JavaScript
Kateryna Yushchenko (scientist)
Kibibytes
Linked list
List (computing)
LLVM
Logical address
Lookup table
Low-level programming language
Machine code
Magic cookie
Main function
Malloc
Managed code
Megabyte
Memory address
Memory allocation
Memory leak
Memory segmentation
Method (computer programming)
Microcontroller
Modula-2
Modula-3
Name binding
Nullable type
Null pointer
O
Oberon (programming language)
Object (computer science)
Object-oriented programming
Object Pascal
Offset (computer science)
Opaque pointer
Optional type
Option type
Oxford English Dictionary
Paging
Pascal (programming language)
Pascal programming language
Perl
Physical address
Physical Address Extension
Pointer swizzling
Procedural programming
Program flow
Programmer
Programming language
Protected mode
Queue (abstract data type)
Raw data
Recursion
Recursion (computer science)
Reference (C++)
Reference (computer science)
Reference counting
Run-time type information
Rust programming language
Segmentation fault
Smart pointer
Software architecture
Software bug
SQL
Stack (abstract data type)
Standard C library
Static program analysis
Static types
Storage violation
String (computer science)
String algorithms
Strong and weak typing
Subroutine
Switch statement
Syntax (programming languages)
System call
System Development Corporation
Tagged pointer
The C Programming Language
Tree (data structure)
Turbo Pascal
Type conversion
Typedef
Type safety
Type system
Unconditional branch
Undefined behavior
Variable (computer science)
Virtual address
Virtual memory
Virtual method table
Void type
Wild branch
Wild pointer
Word (computer architecture)
Word-addressable
Wrapper function
X86
X86-64
Zero-based numbering
Quote
enI do consider assignment statements and pointer variables to be among computer science's "most valuable treasures."
Reason
enMany sections without any references
SameAs
4285887-2
Adresmontrilo
Bendir
Con trỏ (lập trình máy tính)
Duo4
İşaretçiler
m.02c0cf
Mutató (programozás)
Osoitin (ohjelmointi)
Peger
Pekare
Penuding (pengkomputeran)
Pointer (computer programming)
Pointer (computer programming)
Pointer (programmeerconcept)
Pointeur (programmation)
Pokazivač (programiranje)
Pontator (programmazion)
Ponteiro (programação)
Puntatore (programmazione)
Punter (programació)
Puntero (informática)
Q118155
Rodyklė (programavime)
Ukazatel (programování)
Ukazovateľ (informatika)
Viit (informaatika)
Wskaźnik (typ danych)
Zeiger (Informatik)
Δείκτης (πληροφορική)
Вказівник
Көрсөткүч
Нұсқағыш
Показивач (програмирање)
Указател (програмиране)
Указатель (тип данных)
מצביע
اشاره‌گر (علوم رایانه)
مؤشر (برمجة)
पाइंटर (प्रोग्रामिंग)
சுட்டு (நிரலாக்கம்)
പോയിന്റർ
პოინტერი (კომპიუტერული პროგრამირება)
ポインタ (プログラミング)
指標 (電腦科學)
포인터 (프로그래밍)
Source
enDonald Knuth, Structured Programming, with go to Statements
Subject
Category:American inventions
Category:Articles with example C code
Category:Data types
Category:Primitive types
Thumbnail
Pointers.svg?width=300
Url
pointers-in-c.html
WasDerivedFrom
Pointer (computer programming)?oldid=1123930503&ns=0
Width
33.0
WikiPageInterLanguageLink
Datatyp
WikiPageLength
72555
Wikipage page ID
459018
Wikipage revision ID
1123930503
WikiPageUsesTemplate
Template:Authority control
Template:Citation needed
Template:Cite book
Template:Colbegin
Template:Colend
Template:Commons category
Template:Data types
Template:Main
Template:More citations needed
Template:Other uses
Template:Quote box
Template:Reflist
Template:See also
Template:Short description
Template:Vanchor
Template:Visible anchor
Template:Webarchive
Template:Wikibooks
Template:Wikiversity