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 make simplifying Boolean algebra easier?


Describe a queue data structure.


Explain how the even parity system works when transmitting ASCII codes. Include a description of the roles of the sending device and the receiving device during transmission.


Explain how the fetch execute cycle works? Include the specific registers and buses being used