0

i don't really understand about 'heap' and 'stack'. can anybody give me some easy-understanding examples please?

13th Jun 2016, 11:26 AM
Pham Bao Ngoc
Pham Bao Ngoc - avatar
3 Respostas
+ 1
Heap and stack are the two kinds of dynamic memory you use in C++ (as in opposite to static memory). On the stack, every local variable is put and also automatically removed. On the heap everything is put that is allocated via new operator.
15th Jun 2016, 8:49 PM
Stefan
Stefan - avatar
0
a source code when get compiled . various memory section are created based on codes. the memory allocated for local variable is from stack but program need memory at run time its allocate from heap
13th Jun 2016, 1:04 PM
Ganesh K
Ganesh K - avatar
0
thank you very much guys :)
16th Jun 2016, 1:54 AM
Pham Bao Ngoc
Pham Bao Ngoc - avatar