If a program has 4 functions then will all of them be able to access the data held by a global variable?

If a program has 4 functions then will all of them be able to access the data held by a global variable?
A. Yes
B. No
 
Answer: A
Explanation: Any global variable when defined in a program automatically is open for all functions present in the program to access and perform read or write operations. On the contrary any variable defined within the scope of a function, will only be able to be accessed within the function itself.
 

Tìm kiếm

Back
Top