pointer

A value that stores the memory location of another piece of data, so the program can follow it to that data.

In more detail

Passing a pointer lets a function change the original value instead of a copy, and lets many parts of a program share one value. A pointer that points at nothing is called null or nil, and following it crashes the program in most languages.

Examples

p := &name
*p = "worker"
React fibers use child, sibling and return pointers to form a tree that can be walked without recursion.

Related terms

Taught in

References