?:

Checkpoint Technologies ckp at grebyn.com
Sat Feb 3 15:59:07 AEST 1990


In article <6200014 at ux1.cso.uiuc.edu> phil at ux1.cso.uiuc.edu writes:
>
>Do any compilers accept this kind of syntax (which as far as I can tell is
>bogus C since ?: does not yield an lvalue, but is not ambiguous):
>
>    ( a == b ? x : y ) += z;    /* x and y are lvalues */

	How about this:

	*((a == b) ? &x : &y) += z;

	Of course x and y must be of the same type, or at least
reasonably compatible types (if you feel adventurous - not that this is
what I'm reccommending, mind you).



More information about the Comp.lang.c mailing list