Qus:    What is a stack? What is a heap? Give the differences between the two?
Oct 29, 2020 09:18 2 Answers Views: 108 SAI

 



Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM. Variables allocated on the heap have their memory allocated at run time and accessing this memory is a bit slower, but the heap size is only limited by the size of virtual memory.

Prev Next
Answers (2)
DIVYA Oct 30, 2020 04:05
Answer:   Stack is a place in the memory where value types are stored. Heap is a place in the memory where the reference types are stored.
Check this link for the differences

PARTH Nov 09, 2020 08:10
Answer:   Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM. Variables allocated on the heap have their memory allocated at run time and accessing this memory is a bit slower, but the heap size is only limited by the size of virtual memory.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect