Checkpoint 2.1.1. Global Variables vs. Parameters.
- Global variables can be accessed and modified by any function within the program, while parameters are limited to the specific function they are declared in.
- Global variables are stored in the heap memory, while parameters are stored in the stack memory.
- Global variables have a longer lifespan and persist throughout the entire execution of the program, whereas parameters are temporary and remain in scope only during the execution of their respective function.
- Global variables can only hold integer values, whereas parameters can store any data type.
What is the primary difference between global variables and function parameters? Select all that are true.