Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 global vs local variables
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
person




PostPosted: Fri Oct 07, 2005 7:10 pm   Post subject: global vs local variables

y have both global and local variables??

y not make them all global?
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Oct 07, 2005 7:17 pm   Post subject: (No subject)

Aside from the many other reasons to use locals:

When you localize variables inside a function, you remove the need to peruse the entire source code to look for influences.

When you use local variables and parameters/arguments properly, pretty much everything you need to know is within the function definition.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: