Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

dangling pointer

A pointer that still holds the address of something that has already been freed or has gone out of scope.

A dangling pointer refers to storage whose lifetime has ended (a freed heap block, a returned function's stack slot); dereferencing it is undefined behaviour and may read stale data, data of a newer object at the same address, or fault.

Examples

  • Returning the address of a local variable gives the caller a dangling pointer.

Read the full section →