logo

Question detail

What is the main purpose of a stack frame when a subroutine is called?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

What is the main purpose of a stack frame when a subroutine is called?.

  1. A.To store information needed to pause and later resume the calling subroutine
  2. B.To permanently store every value used by the whole program
  3. C.To translate the subroutine into machine code
  4. 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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.