Machine-translated by Google. Questions are authored in English.
Top

Discussion

The offset recorded for a local variable is measured from

  • A.the beginning of the compiled object file
  • B.the first instruction of the whole program
  • C.the address of the previous local variable declared
  • D.the start of the activation record for its procedure

Answer: D

Locals live in the activation record created on each call, so their addresses are relative to a frame pointer. Only globals can be given an address fixed at compile time. Recursion is precisely why a local cannot have a fixed address.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.