When is a statement an expression?

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Apr 27 22:38:57 AEST 1989


In article <1043 at itivax.iti.org> scs at vax3.iti.org (Steve Simmons) writes:
>	a = if ( a == 1 ) 12 ; else 14 ;
>Anybody else ever use stuff like this?

How could they, since it was never valid C?  Why do you think there
had to be a ?: operator if the above was supposed to work?

If you had a compiler that accepted the above code and produced the
answer you expected, it was due to some fortuitous combination of
factors specific to that particular compiler, including lack of
diagnostic ability.



More information about the Comp.lang.c mailing list