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 55 using 8-bit unsigned binary?


Describe the difference between TCP and UDP.


Convert the hexadecimal '3E', which represents a 2's compliment binary number, in decimal.


The numbers 6B and 12 are displayed in hexadecimal form. Convert them into binary form and perform binary addition to find the sum. Convert your answer back into hexadecimal. Show your workings.