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 ▸

How do I solve a Karnaugh Map?


One member of a chess club sends a text file saved in Unicode. What meant by the term "Unicode" and why might this be necessary?


What is an OOP (Object Oriented Programming) language?


Describe the process of a binary search.