whole-program variable
nounUK /həʊl ˈprəʊɡræm ˈveəriəbl/
US /hoʊl ˈproʊɡræm ˈveriəbl/
A box in a computer program that every part of the program can see and use.
The score is stored in a whole-program variable so every screen can show it.
RELATED WORDS
OTHER MEANINGS
2. A variable declared outside all functions so its lifetime lasts until the program ends.
Declaring the counter as a whole-program variable kept its value between calls.
3. A setting that affects the entire application rather than one function.
The debug flag is a whole-program variable that turns logging on everywhere.
4. In some languages, a variable with file or module scope that is visible across the whole compilation unit.
In C, a static whole-program variable is visible to every function in that file.