What is the difference between stack and heap?



What is the difference between stack and heap?..

Answer / Abdul Mutlib Khan

Stack and heap are two areas in a computer's memory used for data storage. The stack is used for local variables, function calls, and return addresses, while the heap is used for dynamic memory allocation such as objects and arrays.nnThe stack has a fixed size and follows a Last-In-First-Out (LIFO) principle, meaning the last item added to the stack is the first one to be removed. In contrast, the heap does not have a fixed size and follows a dynamic memory allocation policy.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

How do I open a csv file on my phone?

1 Answers  


Explain stack and heap?

1 Answers  


 Assume that system is running low on memory. What can system do for suspended apps?

1 Answers  


Find the letter count in UItextfield? Including first character?

1 Answers  


Explain how to hide images in ios?

1 Answers  


Explain what is a framework?

1 Answers  


What is oops in ios?

1 Answers  


What is nsmanagedobjectcontext? What are the different concurrency types? Explain them.

0 Answers  


what is the difference between bounds and frame?

1 Answers  


What is framework in ios?

1 Answers  


What’s the difference between not-running, inactive, active, background and suspended execution states?

1 Answers  


What persistent storage core data uses to save data?

1 Answers  


Categories