View Single Post
  #9   Spotlight this post!  
Unread 26-01-2007, 12:44
ScottWalls ScottWalls is offline
Registered User
FRC #0245 (AdamBots)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2003
Location: Rochester Hills
Posts: 31
ScottWalls will become famous soon enoughScottWalls will become famous soon enough
Re: Why Static Variables?

Out of curiosity, is the only difference between a global variable accessed by the function and a static variable created and accessed by the same function scope? It seems that since both the static variable and the global variable are stored in standard RAM, they would have the same speed, and static variables could simply not be accessed by other functions as globals could. (This isn't to imply that statics are useless, as they would avoid many name conflicts, although I tend to name all of my variables exclusively anyway. I'm only trying to clarify that my grasp of their use is correct).