cond. op. on ='s LHS

Hugh Grierson hugh at fivegl.co.nz
Tue Feb 19 01:16:15 AEST 1991


In article <1991Feb13.223412.28254 at grebyn.com> ckp at grebyn.com (Checkpoint Technologies) writes:
>In article <4155 at cernvax.cern.ch> burow at cernvax.cern.ch (burkhard burow) writes:
>>I'm wondering if anyone has any comments on using:
>>
>>       *(a==b?&c:&d) = 1;

[general Ugh comments...]

>The only time I would use the first form is in a macro, in a situation
>where I really wanted an expression rather than a statement.  But that's
>all.

Even then it would be better to use...

#define cord(a,b,c,d) (a==b?c=1:d=1)

-- 
Hugh Grierson     hugh at fivegl.co.nz | Perfection is attained not when there is
5GL International Ltd,              | no more that can be added, but when there
Auckland, New Zealand               | is no more that can be taken away.



More information about the Comp.lang.c mailing list