e1?(void_e2):(void_e3) so, is it legal or what?
Brett Galloway
brett at wjvax.UUCP
Wed Sep 3 03:11:05 AEST 1986
In article <114 at methods.UUCP> cary at methods.UUCP (Cary Timar (U of W co-op)) writes:
>In article <248 at desint.UUCP> geoff at desint.UUCP (Geoff Kuenning) writes:
>>
>>Unfortunately, Brett is incorrect here. You can't use if/then/else to write:
>>
>> for (i = up ? 0 : 99; up ? (i < 100) : (i >= 0); up ? i++ : i--)
>> {
>> /* complex loop body */
>> }
I don't know what I originally said. What I MEANT to say was that the
'?:` operator is useful. There are cases (such as within macros) where
if/then/else is not appropriate. That's all.
--
-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett
More information about the Comp.lang.c
mailing list