+ 3
Heap & Stack
How can heap and stack be used? I only know mainly the fundamentals, so it’s kinda hard to try to comprehend people’s examples of heap and stack. Can someone simply it?
3 Antworten
0
Stack and heap both are part of memory layout of any program.
When we allocate memory dynamically( like malloc in c),
Then it is allocated in heap.
And function parameters, local variables, return addresses are allocated in stack.