Exam-style question
Try this first
What is the main purpose of a stack frame when a subroutine is called?.
- A.To store information needed to pause and later resume the calling subroutine
- B.To permanently store every value used by the whole program
- C.To translate the subroutine into machine code
- D.To determine which programming language the subroutine uses
Model answer
What a good answer should say
- To store information needed to pause and later resume the calling subroutine
Explanation
Why this works
A stack frame stores details for one active subroutine call, including the return address, parameters and local variables. This allows the subroutine to execute and then return correctly.
Common mistake
No common mistake is linked to this question yet.
