vgnndd
Mar 7, 2012, 06:50 AM
What is meant by the phrase "the scope of a variable" and how does it relate to subroutines and modules?
camyyssa
May 17, 2012, 02:08 AM
Useful read: http://en.wikipedia.org/wiki/Scope_(computer_science)
WildProgrammer
Oct 1, 2012, 09:35 AM
Hello!
The scope of a variable mean wher in the program your variable will be accessible to your code. Depending where it is declare the scope will vary,if you declare it into a function it will be available only into that function, if you declare it into a loop you will be able to use it only into that loop, if you declare it before main() it will be global and accessible every where into the program but global variable are rarely the way to go.
hope this was helpful