0
i don't really understand about 'heap' and 'stack'. can anybody give me some easy-understanding examples please?
3 Answers
+ 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.
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
0
thank you very much guys :)