740 views

1 Answer

2 2 votes

Pls Pls read the first answer:

 

https://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap

 

I cannot explain as good as the person answering there so i linked it..Waiting for the banhammer 😭

 

Although simply speaking heap and stack both are on Virtual memory and therefore can be on RAM or HDD but stack is easily trackable as only the first element(last entered) is used and removed (simultaneously sometimes). However Heap is assigned randomly as needed, so takes more time to track as address needs to be calculated according to demand. This is not done in Stack as the top of stack is always known and does not need to be calculated.

 

Please verify anyone I do not know how to point to people.

Position:
Show:

Related questions

1 1 vote
1 1 answer
3.6k
3.6k views
radha gogia asked Oct 19, 2015
3,618 views
what is the meaning of the below paragraph"The  large blank space between stack and the heap is a part of virtual address space but will require actual physical pages onl...
0 0 votes
1 1 answer
833
833 views
sh!va asked Dec 6, 2016
833 views
Interview Question:1) How size of a stack and heap memory for a proces is decided?2) I wrote a program with no data or instructions. How text, data, stack ,heap will be a...
0 0 votes
0 0 answers
1.0k
1.0k views
HeadShot asked Dec 14, 2018
1,023 views
Please explain points in short, and intuition behind its working.​​