Exam-style question
Try this first
A subroutine has two parameters and three local variables. Which statement best describes the stack frame created for one call?.
- A.It can contain the return address, the two parameters and the three local variables
- B.It contains only the return address because variables are stored in the program code
- C.It contains only the local variables because parameters are stored in the calling subroutine's frame
- D.It contains the return address but cannot contain values associated with variables
Answer and explanation
Concise answer
It can contain the return address, the two parameters and the three local variables
Why this is correct
A stack frame holds the information associated with a particular subroutine call. This includes the return address, parameter values and local variables.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
