liveBook · Manning

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.

How 2 Manning books explain it

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.

Read how Modern C explains automatic storage →

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

Related concepts

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.