View Single Post
  #3   Spotlight this post!  
Unread 23-01-2007, 22:14
ebarker's Avatar
ebarker ebarker is offline
Registered User
AKA: Ed Barker
FRC #1311 (Kell Robotics)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Kennesaw GA
Posts: 1,437
ebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond repute
Re: Why Static Variables?

The keyword here is "scope".

Scope for a global and a static in a local function is different.

A static is persistant, therefore the permanent portion of the memory map is larger, more memory usage (a disadvantage). But the static could be local to a function.

A global is essentially static, but the scope is precariously large.