cond. op. on ='s LHS

Stephen Clamage steve at taumet.com
Sun Feb 17 08:51:15 AEST 1991


kers at hplb.hpl.hp.com (Chris Dollin) writes:

>.. how would people feel if conditionals could deliver lvalues, ie, so that
>    (a == b ? c : d) = 1;
>was legal and had the obvious meaning?

As has been pointed out before, this is an extension to Gnu C.

The expression is also legal C++, as long as c and d are both lvalues
and have the same type (although not all compilers yet implement this
feature).
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.lang.c mailing list