469,619 Members | 1,914 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,619 developers. It's quick & easy.

static variable memory storage

Hi,

I have a doubt of storing static variables in memory.I think
static,global variables are stored in the same location.Static,Gloabal
variables are stored in HEAP .Can anybody explain me the storage area
of all type variable in memory
Rgds,
Mani

Feb 27 '06 #1
2 4467

pl**********@gmail.com wrote:
Hi,

I have a doubt of storing static variables in memory.I think
static,global variables are stored in the same location.Static,Gloabal
variables are stored in HEAP .Can anybody explain me the storage area
of all type variable in memory
Rgds,
Mani


Does the language have any idea about heap or stack (As in storage
areas) ? Isn't it implementation dependant ? If yes, then I guess we
should not be worried about where those variables are stored.

Feb 27 '06 #2
pl**********@gmail.com wrote:
Hi,

I have a doubt of storing static variables in memory.I think
static,global variables are stored in the same location.Static,Gloabal
variables are stored in HEAP .Can anybody explain me the storage area
of all type variable in memory


C++ knows three types of memory storage types: static, dynamic and
automatic.
static memory is used for variables in namespace scope and static local
variables. dynamic memory is used by operator new and by *alloc. automatic
memory is used for non-static local variables.

Feb 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Scott J. McCaughrin | last post: by
27 posts views Thread by Mr. Ed | last post: by
3 posts views Thread by Datta Patil | last post: by
6 posts views Thread by junw2000 | last post: by
53 posts views Thread by fdmfdmfdm | last post: by
18 posts views Thread by akhil.misra | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.