Computer Science / Unit 7 CS 0369 short lesson, about 20 seconds
The Scope
Captions available
The idea
A variable's scope controls its visibility and lifetime — a variable local to a function exists and can be seen only within that function, only while it executes.
In practice
A player's turn-score lives inside the turn and vanishes with it.
Where people slip
Visibility and lifetime travel together; scope sets both.
Your place on the trail
Every lesson rests on earlier ones and opens later ones. Tap any to jump.
Unlocks
- Nothing yet depends on this.
Something wrong in this lesson? Flag it · Sources for Computer Science