|
|
As I recall in older versions of C you could only initialize the first
element in a union, any remaining space being zero-initialized. I think
that if you don't specify a field name in the initialization it still
sets the value of the first field. Non totally sure though, since I
rarely use unions in my code (the POD restriction gets in the way, and
I'm not writing code where the memory reduction is really important anyway).
On 2/17/2011 10:29 AM, Darren New wrote:
>
> Under what circumstances does it matter what order the members of a
> union are written in? When does it make a difference as to which type
> inside the union is declared first?
>
Post a reply to this message
|
|