Computer Science EngineeringHardISRO SC

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

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

Correct answer: D. 0

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

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

Exams that ask this topic