By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

stack and heap

P: 79
For object declaration in c++, what are the differences between
1/ myClass x; (for the stack)
2/ myClass *x = new myClass; (for the heap)
???
Mar 21 '07 #1
Share this Question
Share on Google+
3 Replies


RedSon
Expert 5K+
P: 5,000
One uses memory form the stack and one uses memory from the heap.
Mar 21 '07 #2

P: 79
One uses memory form the stack and one uses memory from the heap.
Actually, i would like to ask what the difference between stack and heap and their effect.
Mar 21 '07 #3

RedSon
Expert 5K+
P: 5,000
Woah, look what I found, this is a sweet article.

http://computer.howstuffworks.com/c28.htm
Mar 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.