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

Discussion

Members of a union are accessed as ________________

  • A.union-name.member
  • B.union-pointer->member
  • C.Both a & b
  • D.None of the mentioned

Answer: C

Correct answer: Both a & b

A union member is reached exactly as a structure member is: with the dot through a variable (u.member) and with the arrow through a pointer (p->member). The syntax is identical; only the storage layout differs.

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

Post your comment

Please log in or register to post a comment.