What is the difference between local and global variables?

Local variables are defined within a subroutine. Their scope/visibility ends when the cursor leaves the subroutine.
Global variables on the other hand are variables that exist outside of all the subroutines and functions, and are available to all of them.

CD

Related Computing A Level answers

All answers ▸

Describe the operations of an optical disk drive used to read data from an optical disk, such as a CD or DVD.


Simplify the following Boolean expression: ¬(AvB) v ¬(CvD) v ¬A^(BvC) v (¬A^A)


Calculate -3 + 3 using Two's Complement and the Sign and Magnitude Method. Which works correctly?


Convert 10101100 to decimal.