Questions of storage in C++

A

away

I read in this newsgroup about storage of the following types:

*free storage*
*automatic storage*

Is there any other types besides the above two?

Should we use "heap" and "stack" at all when dealing with object creation in
C++?

Thanks!
 
R

Rolf Magnus

away said:
I read in this newsgroup about storage of the following types:

*free storage*
*automatic storage*

Is there any other types besides the above two?

Yes. There is static storage. It's where Variables on namespace scope as
well as static member variables and static local variables are stored.
Should we use "heap" and "stack" at all when dealing with object creation
in C++?

You mean the words "heap" and "stack"? IMHO, no. Both words are defined in
C++, but they both have a different meaning. The free storage is what you'd
call "heap", the automatic storage would be the "stack" (note that C++
doesn't require automatic data to be actually stored on a stack).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,947
Members
47,498
Latest member
log5Sshell/alfa5

Latest Threads

Top