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

Discussion

Translating a pointer dereference produces an instruction of the form

  • A.x = &y, taking the address of the named variable
  • B.x = y[i], indexing an array by a computed subscript
  • C.param y, which sets up one argument for a procedure call
  • D.x = *y, an indirect assignment reading through the pointer

Answer: D

Correct answer: x = *y, an indirect assignment reading through the pointer

Three address code needs distinct forms for the pointer operations: taking an address, reading through a pointer, and writing through one. The dereference reads the value at the address held in y. Its presence complicates optimisation greatly, since the compiler may not know what y points at.

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

Post your comment

Please log in or register to post a comment.