Pointer

A pointer is a variable that stores the memory address of another value, rather than the value itself. It 'points to' where the data lives in memory.

General Programming

Pointers are common in low-level languages like C and C++ and give precise control over memory. Higher-level languages like Python and JavaScript hide them, using references instead.

Examples

C

int x = 5;
int *p = &x;   // p holds the address of x
printf("%d", *p);  // dereference to read the value

Output:

5

See also

Back to the Dictionary