GLOBAL & LOCAL VARIABLES
global variables are variables that can be accessed and use by ANY function in a program. local variables are variables that can be accessed ONLY by the function in which they are defined. both are declared similarly in C, but look completely different in assembly
GLOBAL VARIABLES
EXAMPLE 1:

EXAMPLE 2:
the global variables are referenced by memory addresses
LOCAL VARIABLES
the local variables are referenced by the stack addresses...not the use of square brackets.

Last updated