Computer Science EngineeringHardISRO SC

Nested procedures use static (access) links. A procedure at nesting depth 4 references a local variable declared in an enclosing procedure at nesting depth 1. How many static links must be followed to reach that variable's activation record?

  1. A. 4
  2. B. 3
  3. C. 2
  4. D. 1

Correct answer: B. 3

The number of static-link hops is (use depth) - (declaration depth) = 4 - 1 = 3.

More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions

Exams that ask this topic