home | list info | list archive | date index | thread index

Re: what is the purpose of a union with only a single member?


Quoting rpjday [ at ] crashcourse [ dot ] ca:

reading someone else's code, and ran across a declaration of the form:

  union thingy *thingy;

(yes, the same name is used both for the union type and instance,
but that's not why we're here.)

  what is the purpose of defining a union with only a single
member? is this some tricky feature of C that i'm unaware of?
i would *think* that this is equivalent to just writing:

  struct thingy *thingy;

but i'd really like to be sure. thoughts?

rday

  never mind, i just misread the code. sorry, carry on.

rday




To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org