pickzy.com

C  |  C++  |  Objective-C  |  VC++  |  Win32  |  MFC  |  Java  |  Php  |  Delphi  |  Visual Basic  |  .Net  |  Networking  |  General  |  Games  |  Jobs  |  Javascript  |  




Menu

pickSourcecode.com


        

 




 

Cpp > Solution

 

What is difference between heap memory and stack memory?

 Difference Stack vs Heap


Stack

When a function or a method calls another function which in turns calls another function 
etc., the execution of all those functions remains suspended until the very last function returns its value.

This chain of suspended function calls is the stack, because elements in the stack (function calls) 
depend on each other.

The stack is important to consider in exception handling and thread executions.

Heap
The heap is simply the memory used by programs to store variables.
Element of the heap (variables) have no dependencies with each other 
and can always be accessed randomly at any time.


 
Privacy Policy | About Us