Jump to content

  • Log In with Google      Sign In   
  • Create Account


akira2000

Member Since 26 Aug 2005
Offline Last Active Feb 25 2013 03:06 AM

Topics I've Started

stack vs heap

15 February 2013 - 06:38 AM

Hello.

 

I'm working as java programmer and just now starting to learn c++ and irrlicht (want to create games as a hobby ;) ).

I am completely confused by stack vs heap issue.

What is the advantage of using heap? Isn't it MUCH faster and more efficient to create variales on stack and pass them by reference.

What I mean is:

 

Object obj = new Object();

 

VERSUS

 

Object obj;

method1(&obj)

 

I am also confused by memory managment in c++. When stack object is freed is there a memory "hall" in stack.  

 

Thanks 


PARTNERS