Podcast
Questions and Answers
What is the purpose of a fixed region of memory in a program?
What is the purpose of a fixed region of memory in a program?
- To store local variables
- To store program instructions
- To store global variables (correct)
- To store function calls
What is the downside of using too many global variables in a program?
What is the downside of using too many global variables in a program?
- Unknown and unwanted side effects (correct)
- Improved program efficiency
- Easier debugging
- More accurate program output
Why should unnecessary global variables be avoided in a program?
Why should unnecessary global variables be avoided in a program?
- They make functions more general
- They take up memory the entire time the program is executing (correct)
- They increase program stability
- They improve program efficiency
What is the potential problem with using too many global variables in a C program?
What is the potential problem with using too many global variables in a C program?
Why should unnecessary global variables be avoided in a program?
Why should unnecessary global variables be avoided in a program?
How can using a global variable instead of a local variable affect a function's generality?
How can using a global variable instead of a local variable affect a function's generality?