what is heap and why we use itView more random threads:
- Abstract data type (ADT) in C++ 2012
- what is heap and why we use it
- where we use scoope resulation operation in c++?
- Create new variables with a loop? in c++ 2011 -12
- Function also provides encapsulation, what it means with an...
- How to Write a function factorial in C++ and java and php...
- Argc(argument count) and argv(argument value) are used in...
- oop an procedral programming 2011
- Member access specifier is a C++ Operator
- what is anonymous in c 2011
Sponsored Links
There are two places that stores items in memory as your code executes. These are Stack and the Heap. Both the stack and heap help us run our code. They reside in the operating memory on our machine and contain the pieces of information we need to make it all happen. Stack memory stores variable types in address' in memory, these variables in programming are called local variables and are often stored for short amounts of time while a function/method block uses them to compute a task. once a function/method has completed its cycle the reference to the variable in the stack is removed. Heap memory stores all instances or attributes, constructors and methods of a class/object. A Heap reference is also stored in Stack memory until the life cycle of the object has completed. Inside the Heap reference all the contents of the object are stored whereas with a local variable only the variable contents are stored in the stack. When the data is washed out of ram then system cannot continue its work from the last end point instead it needs to recall the data into the memory to start processing.Examples of heap implementrion are given on the following links.
An Introduction to Data Structures with C++
Source Code for Data Structures and Algorithm Analysis in C++ (Second Edition)
There are currently 1 users browsing this thread. (0 members and 1 guests)