|
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.
|