๐Ÿ’ปap computer science a review

Global variables

Written by the Fiveable Content Team โ€ข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโ€ขWritten by the Fiveable Content Team โ€ข Last updated September 2025

Definition

Global variables are variables that are declared outside of any function and can be accessed from anywhere within the program. They have a global scope, meaning they can be used by any part of the code.

"Global variables" also found in: