Computer ScienceProgrammingMedium

Pointer (programming)

Also known as:memory pointeraddress variablereference (loosely)

A pointer is a variable that stores the memory address of another variable rather than a data value directly. Pointers enable direct memory access and manipulation, dynamic memory allocation, and efficient passing of large data structures without copying. They are central to languages such as C and C++, and understanding them is key to systems programming, data structure implementation, and performance-critical software.

Pointer Operations and Their Meanings in C

OperationSyntax (C)MeaningExample Result
Declarationint *p;p is a pointer to intp holds an address
Address-ofp = &x;Assign address of x to pp = 0x7fff5a
Dereference*pValue at address pValue of x
Pointer arithmeticp + 1Next int address (+4 bytes)Next array element
NULL pointerp = NULL;Pointer points to nothingSafe uninitialised state

Interactive Tools

Codecademy – Learn C

Open Tool

Brilliant – Memory and Pointers

Open Tool

Khan Academy – Memory and Pointers

Open Tool
Diagram showing a pointer variable storing the address of another variable in memory

Wikimedia Commons, CC BY-SA

Related Terms

From Old French "pointer" (to indicate or point). In computing, the term was popularised during the development of languages like BCPL and C (Dennis Ritchie, early 1970s) to describe variables that "point to" memory locations.

pointermemory-addressc-programmingsystemsdereferencing