0 0 votes Programming in C + – Somdatta Sen 740 views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Swapnil Naik commented Feb 9, 2019 reply Follow flag think in terms of cache memory 0 0 replyShare Somdatta Sen commented Feb 10, 2019 reply Follow flag Could you please elaborate your answer? 0 0 replyShare Please log in or register to add a comment.
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. Arko Jyoti Shith answered Feb 15, 2019 Arko Jyoti Shith comment Share Follow 0 reply Please log in or register to add a comment.