Scope of 'static' variables

Henry Spencer henry at zoo.toronto.edu
Tue Nov 27 04:32:19 AEST 1990


In article <7744.27500de8 at jetson.uh.edu> elee6i5 at jetson.uh.edu writes:
>But how is 'scope' preserved for such static variables 
>declared inside a function ?

Easily.  The compiler compiles code exactly as if you had declared the
variable outside the function.  The only thing it does differently is
to keep an eye on where you are using the variable, and forbid use of
it outside that function.
-- 
"I'm not sure it's possible            | Henry Spencer at U of Toronto Zoology
to explain how X works."               |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list