+ 2

What is use of global variables??

We use variable almost all languages like c c++ js php etc. Then why we can't use a global variables for all programming languages???

25th Jul 2019, 3:16 AM
Aman Tiwari
Aman Tiwari - avatar
1 Réponse
+ 1
+ if there is global variable name1 you cant use this name in all programs in project for different usage. There is risk you think name1 is local but you change variable for others without you know it. I saw global variable with name i in script language in bigger project, because some programmers declare i as local and other no there was strange situations.
25th Jul 2019, 6:16 AM
zemiak