Course contentsShow
Computer Science
Lesson 2081 of 2,87247. Memory Management in LanguagesPro lesson

Stack vs Heap: Lifetime and Scope

Stack variables live until function returns; heap objects persist until explicitly freed or garbage collected.

This lesson is for subscribers

You've completed the free preview. Subscribe to unlock every lesson in every course.