Re: what's this syntax?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Gong wrote:
Hi, Ian and Mike,

Thanks for the information.

Now I understand the following code is "the value of the member b of a compound literal which is initialized by a designated initializer". Is it correct ?

( ( union { int a; int b; }) { .a =7 }).b

Yes.  It looks like a clever/obscure way to use a union
to recast a value.  Would make more sense if b were a float.

--
Michael Eager	 eager@xxxxxxxxxxxx
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux