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.
Embedded Software with Rust
Memory whose allocation persists for the entire execution of a program.
- How it is used
- Uses static storage for persistent data and deterministic memory use in resource-constrained firmware.
- How deep it goes
- Explains placement, startup initialization, lifetime, and memory-region trade-offs without showing a static declaration.
- Examples
- Identifies lookup tables, configuration constants, and global state as uses for static memory.
- What you can do after
- Evaluate static storage against stack and heap allocation for persistent data in embedded firmware.
Read how Embedded Software with Rust explains static storage →
What to know first
- memory locationA memory location is an addressable unit or region of computer memory identified for storing or accessing data or instructions.
- compound literalA compound literal is a C expression consisting of a parenthesized type name followed by an initializer that creates an unnamed object.
- file scopeFile scope is the C scope of an identifier declared outside any function or block and extending to the end of the source file.
- initializationThe process of establishing initial values or a starting state for a program entity, component, resource, or computation before subsequent operation.
Related concepts
- initializationconfigures · 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.
Questions about static storage
What is static storage?
Static storage duration is the storage duration of an object whose lifetime extends throughout program execution.
Which Manning books explain static storage?
Modern C, Third Edition, Modern C and Embedded Software with Rust.
What should I know before learning static storage?
Manning books that teach static storage usually introduce memory location, compound literal, file scope and initialization first.
What is static storage a kind of?
Static storage is a kind of storage class. A storage class specifier is a C declaration keyword that specifies an object's storage duration, linkage, or related declaration properties.
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.


