Module 7 · Functions, Scope and Storage Classes
Storage Classes: auto, static, extern, register
Free with an accountReading
Kenji is building a quiz game. Each time a round starts, the game should announce its number: round 1, round 2, round 3.
Sign in to read
This lesson is free, with an account
An account costs nothing and opens every lesson in this track that is not marked Pro, on every device you read on.
What is inside Storage Classes: auto, static, extern, register
- Kenji's counter forgets
- static: a local that survives the call
- Initialised once, before main starts, to 0 by default
- The three questions, one table
- static on a global: private to its file
- extern: defined in another file
- register and auto: two words you will not write