Scope of 'static' variables

elee6i5 at jetson.uh.edu elee6i5 at jetson.uh.edu
Mon Nov 26 11:31:04 AEST 1990


When you use 'static' to initialize an array in side a fn,
as in static int data[3] = {1,2,3}; the array is initialized
before the program runs. Since this can't be allocated on the 
stack frame, it has to be allocated  on the data segment(?).

But how is 'scope' preserved for such static variables 
declared inside a function ?

Could any one explain this ,with reference to  ix86 architecture?

.sundar
elee6i5 at jetson.uh.edu



More information about the Comp.lang.c mailing list