Segmentation fault

Applies to: cpp, c

A segmentation fault happens when a program accesses memory it is not allowed to access, often through a bad pointer.

int* p = nullptr;
// *p = 1;  // likely crash

See also: pointer, undefined-behavior