Beginner
C++
Q22 / 100
What is the difference between stack and heap memory?
Correct! Well done.
Incorrect.
The correct answer is B) Stack is automatically managed (local variables); heap requires manual management (new/delete)
B
Correct Answer
Stack is automatically managed (local variables); heap requires manual management (new/delete)
Explanation
Stack memory is allocated/freed automatically with function calls. Heap memory persists until explicitly freed with delete, enabling dynamic lifetimes.
Progress
22/100