Lesson 12 of 50 · c
Variable Scope & Storage Classes
Duration: 9 mins
C defines storage duration and linkage via storage‑class specifiers.
| Specifier | Description |
|---|---|
auto | Default for local variables (automatic storage). |
static | Persists for the life of the program; internal linkage for functions/variables at file scope. |
extern | Declares a variable defined in another translation unit. |
register | Hint to store in a CPU register (ignored by modern compilers). |
_Thread_local | C11 thread‑local storage. |
Scope describes visibility (block, file, function).