472,119 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 4572

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.