Static storage
Static storage duration is the storage duration of an object whose lifetime extends throughout program execution.
Modern C, Third Edition
A static object is a C object with static storage duration whose lifetime extends across the entire program execution.
- How it is used
- Explains how object lifetime and initialization depend on storage duration.
- How deep it goes
- Defines lifetime, eligible object forms, and initialization constraints, including startup-resolved addresses.
- Examples
- Shows a file-scope object, a static compound literal, and a block-scope static object.
- What you can do after
- Understand which C objects persist throughout execution and how they are initialized.
Modern C
static is a C storage class specifier that gives an object static storage duration and can affect linkage.
- How it is used
- Separates an object's lifetime and initialization rules from the visibility of its identifier.
- How deep it goes
- Defines static duration, its declaration routes, whole-execution lifetime, and initialization constraints, while only briefly noting linker mechanics.
- Examples
- Uses file-scope objects, block-scope static variables, and a compound literal to illustrate static duration.
- What you can do after
- Understand which objects persist throughout execution and how static duration affects their initialization.
Related concepts
- initializationconfigures · Initialization is the process of establishing initial values or a starting state for a program entity, component, resource, or computation before subsequent operation.
- storage classkind of · A storage class specifier is a C declaration keyword that specifies an object's storage duration, linkage, or related declaration properties.
- compound literalused by · A compound literal is a C expression consisting of a parenthesized type name followed by an initializer that creates an unnamed object.
- externconfigured by · extern is a language construct for declaring or referring to entities supplied outside the current declaration or compilation unit, including through external linkage or foreign interfaces.
- stack overflowproduced by · A stack overflow is a runtime failure caused by exhausting the available capacity of a program’s call stack.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

