Lesson 12 of 50
cVariable Scope & Storage Classes
9 mins
Course progress24%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 12 of 50
c9 mins
Keep these ideas in mind as you work through the lesson.
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).