|
Authored by: nsomos on Tuesday, May 22 2012 @ 08:45 AM EDT |
I was surprised to read from eric76
"In many language implementations, variables declared
statically are also stored on the stack."
If this is so, then where do the automatic variables go?
In fixed storage I suppose?
Just to be clear, automatic variables only exist for
the life of the invocation of the function within which
they are declared, and are created anew each time that
function is called.
Static variables, while they may be similarly limited
in scope to the function in which they are declared,
will retain their value from one invocation of said
function to the next invocation, without losing their value.
Is there some small chance that you have your statics
and automatics confused with each other, when you claim
that many languages place statics on the stack?[ Reply to This | Parent | # ]
|
|
|
|
|