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

Discussion

The operator used to get value at address stored in a pointer variable is

  • A.*
  • B.&
  • C.&&
  • D.||

Answer: A

Correct answer: *

The unary * is the indirection, or dereference, operator: it yields the object a pointer points to. Its counterpart & is the address-of operator, going the other way.

The asterisk plays two distinct roles that are easy to conflate. In a declaration it forms a pointer type; in an expression it dereferences. The && and || operators are logical AND and OR and have nothing to do with pointers.

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

Post your comment

Please log in or register to post a comment.