Question:

Which data structure is used by the compiler to manage function calls and local variables (Activation Records)?

Show Hint

This is why infinite recursion causes a "Stack Overflow" error. The system runs out of memory because it keeps pushing new activation records onto the stack without ever popping them.
Updated On: Jul 4, 2026
  • Queue
  • Linked List
  • Stack
  • Heap
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Concept: When a function is called, the system needs to store information about the current state so it can return to it later.
Activation Record (Stack Frame): A block of memory containing the function's parameters, local variables, and the return address.
LIFO Principle: The last function called is the first one to finish and return.

Step 1:
Analyzing function call behavior.
Function calls follow a nested structure. If Function A calls Function B, then B must complete before A can continue. This "Last-In, First-Out" (LIFO) behavior is perfectly modeled by a Stack.

Step 2:
Managing local variables.
The local variables of a function only exist as long as the function is executing. When the function returns, its variables are "popped" off the memory structure. The stack allows for efficient, automatic allocation and deallocation of this memory.

Step 3:
Conclusion.
The Runtime Stack (or System Stack) is the dedicated area of memory used specifically for this purpose. Every time a function is invoked, its activation record is "pushed" onto the stack.
Was this answer helpful?
0
0