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

Discussion

Which of the following are fundamental operation on pointers ?

(i) implicit dereferencing
(ii) indirection
(iii) explicit referencing
(iv) addressing

  • A.(i), (ii) and (iii)
  • B.(i) and (ii)
  • C.(ii) and (iii)
  • D.(iv) only

Answer: A

The key's answer is (i), (ii) and (iii). I could not trace the three-term list to a source, so this follows the key.

A pointer is used through two basic actions: setting it to point at an object, and following it to reach the object it points at. Following a pointer is dereferencing or indirection, which a language may do implicitly (as with Ada's access types and Fortran 90 pointers) or explicitly with an operator such as the * of C. Referencing, the counterpart that produces a pointer to an object (the & of C), is the explicit-referencing item. The standard treatments I found (Sebesta) name two operations, assignment and dereferencing, so the grouping in (i) to (iii) is the paper's own.

Addressing, item (iv), is how a machine locates a memory cell and is not a pointer operation in the language sense, so (iv) only is out, and the pairs that leave out (i) or (iii) are incomplete on the key's reading.

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

Post your comment

Please log in or register to post a comment.