+ 1
What are local and global variables?
c++
2 Réponses
+ 1
Global variables are declared outside any function, and they can be accessed (used) on any function in the program. Local variables are declared inside a function, and can be used only inside that function.
0
Any variable which is inside a specific function is said to be local variable of that function.Any variable called outside a specific function say which is in main function and can be used anywhere in program is global function.