AM22 Tech
»
Technical Discussions
»
C/C++ Discussions
»
What is the difference between a global variable and a local variable?
 Rank: Guest
Joined: 12/12/2009(UTC) Posts: 540
|
What is the difference between a global variable and a local variable?
|
|
|
|
|
|
|
|
|
|
 Rank: Administration
Joined: 1/9/2010(UTC) Posts: 449  Location: India Was thanked: 1 time(s) in 1 post(s)
|
Global variables are accessible throughout the application where local variables are only accessible within the function/method they are declared. The difference is made out on the basis of their usage scope. Global variables can be used anywhere in the whole application whereas local variables are local the function.
|
|
|
|
|
|
AM22 Tech
»
Technical Discussions
»
C/C++ Discussions
»
What is the difference between a global variable and a local variable?
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.