Automatic storage
Automatic storage duration is a C storage duration in which an object's storage is associated with execution of its defining block or function.
Modern C
Automatic storage duration is a C storage duration in which an object's lifetime is associated with execution of its defining block, except for variable-length arrays and temporary objects.
- How it is used
- Explains how runtime block execution determines the lifetime of local objects and their recursive instances.
- How deep it goes
- Develops lifetime, initialization, and address-taking rules, then illustrates a machine realization; distinguishes VLA and temporary-object exceptions.
- Examples
- Uses a shadowed local variable accessed through a pointer and an assembler translation of a function.
- What you can do after
- Evaluate/understand when ordinary automatic objects are alive, why recursive instances differ, and when explicit initialization is needed.
Modern C, Third Edition
Automatic storage duration is a C storage duration in which an object's storage is created on entry to a relevant block or function and released when execution leaves it.
- How it is used
- Uses automatic storage to explain how local objects exist during execution and how recursive calls obtain separate instances.
- How deep it goes
- Explains ordinary block lifetime, exceptions and address constraints, then examines a concrete assembly implementation.
- Examples
- Uses shadowed local variables and an x86_64 assembly listing to illustrate visibility and implementation.
- What you can do after
- Evaluate/understand when ordinary local objects remain alive and recognize lifetime and initialization constraints.
Read how Modern C, Third Edition explains automatic storage →
What to know first
- compound literalA compound literal is a C expression consisting of a parenthesized type name followed by an initializer that creates an unnamed object.
- objectAn object is a distinct entity represented or manipulated within a computational system, typically as a value, data structure, resource, or instance of a type.
- public visibilityPublic visibility is an access-control status that permits a declaration or resource to be accessed from outside its defining scope, subject to applicable visibility rules.
- read-only objectA read-only object is an object that a program is not permitted to modify through its applicable access or type qualification.
Related concepts
- 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.
- variable-length arraycontrasts with · A variable-length array is an array whose bound is determined at run time rather than fixed as a compile-time constant.
- consistency modelused by · A consistency model is a formal specification of how operations on state may be ordered and what values those operations can observe.
Questions about automatic storage
What is automatic storage?
Automatic storage duration is a C storage duration in which an object's storage is associated with execution of its defining block or function.
Which Manning books explain automatic storage?
Modern C and Modern C, Third Edition.
What should I know before learning automatic storage?
Manning books that teach automatic storage usually introduce compound literal, object, public visibility and read-only object first.
What is the difference between automatic storage and explicit initialization?
Automatic storage duration is a C storage duration in which an object's storage is associated with execution of its defining block or function. Explicit initialization is initialization supplied directly by program syntax or operations rather than by an object's storage-duration default.
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.

