Re: How do the compiler knows about the change that is made in the static variable?
ramu wrote:
can anyone tell me how the c compiler remembers the changes
made to the static variable?
As I understand it, it is often the same way that it "remembers"
the values of global variables. The only thing that is different
is that the *name* of the storage (the variable name) has a limited
scope. So, you can think of a static variables as a hybrid between
a global variable and a local variable. It has a lifetime much like
a global variable but a scope just like a local variable.
- Logan
.
Relevant Pages
- Re: static and globals in a thread environment
... you NEVER use a static variable inside a working thread function. ... exceptions, it should not be used (in more than a decade of thread programming, I have ... functions), or pseudo-const global variables (once written, before the threads start, they ... Why do you think you need global variables or static variables at all? ... (microsoft.public.vc.mfc) - Re: Appdomains and mixed mode assembly
... |> instance of this class in other appdomain, then the global variables ... Not so for native static variables. ... True for pure managed assemblies but not for native code global statics, ... these have process scope not domain scope. ... (microsoft.public.dotnet.languages.vc) - Re: handling static variables in parallel code
... just the same as global variables can. ... related to one instance of an object, and somehow the thread gets passed ... Wish the scope of thread-specific data was limited ... similar to the scope of static variables. ... (comp.programming.threads) - Re: static and globals in a thread environment
... There is a __declspecdeclaration that makes apparently-static ... Why do you think you need global variables or static variables at all? ... MVP Tips: http://www.flounder.com/mvp_tips.htm ... (microsoft.public.vc.mfc) - Re: global variables
... > with static variables to achieve the same effect, ... I don't think that this is related to Windows Forms. ... not have "global variables", but you can define, for example, ... (microsoft.public.dotnet.framework.windowsforms) |
|