Re: Static Variables
- From: "Nick Keighley" <nick_keighley_nospam@xxxxxxxxxxx>
- Date: 20 Feb 2007 04:06:48 -0800
please don'e top-post. Put your reply below what you are
replying to, better yet intersperse your reply amongst
the original post. I have re-arranged your post.
On 20 Feb, 10:01, akm.sat...@xxxxxxxxx wrote:
Ian Collins wrote:
akhil.mi...@xxxxxxxxx wrote:
where does a static variable inside a function get stored?? where does
it go in memory?? like Global goes in RAM, Local variable goes on
Stack... but how does static variable takes place in memory??
Stack *is* RAM.
It's an implementation issue. If the detail is important for your
application, consult your compiler's documentation.
--
Ian Collins
please remove sigs (the bit after --<space>)
Compiler manual is not mentioning anything about the storage.
well mostly you don't care. You might want to try a compiler
specific ng. It's even possible the internal details of the
compiler arn't publicly documented.
What do u think can be the best possible solution for static variable
storage?
there probably is no "best" solution. The memory must
be accessible by the function and have a lifetime the same
as the program. It is initialised before it is accessed for t
he first time. It is common for all statics (local and global)
to be in the same lump of memory.
Why do you need to know?
--
Nick Keighley
.
- References:
- Static Variables
- From: akhil.misra@xxxxxxxxx
- Re: Static Variables
- From: Ian Collins
- Re: Static Variables
- From: akm . satyam
- Static Variables
- Prev by Date: Re: Print function name of calling function?
- Next by Date: Re: struct and function pointer in C
- Previous by thread: Re: Static Variables
- Next by thread: Re: Static Variables
- Index(es):
Relevant Pages
|
|