liveBook · Manning

Static storage

Static storage duration is the storage duration of an object whose lifetime extends throughout program execution.

How 2 Manning books explain it

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.

Read how Modern C, Third Edition explains static storage →

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.

Read how Modern C explains static storage →

Related concepts

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.