Which of the following is NOT one of the reasons why global variables may be a bad idea (according to your author)?
A variable in main() with the same name as a global variable causes compiler and runtime errors.
Global variables make a program hard to understand.
Global variables make debugging difficult.
If you want to use a function in another program and this function depends on a global variable, you will have to redesign it.
Answer:
A variable in main() with the same name as a global variable causes compiler and runtime errors.
Comments
Leave a comment