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 ▸

What is the difference between a high level language and a low level language?


What is an interface and why are they useful?


How do you convert from binary to decimal?


What is the difference between Serial and Parallel transmission of data?