cond. op. on ='s LHS
Doug Gwyn
gwyn at smoke.brl.mil
Tue Feb 19 12:42:40 AEST 1991
In article <5672:Feb1814:26:0291 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>> There really is a need for
>> conditional expressions.
>This can be argued. ?: is almost purely syntactic; ...
Yes, but then so is the provision of a multiplicity of ways of
expressing looping. I seldom have occasion to assign the same value
to alternative variables, as in the example that started this thread,
but often I need to assign alternative values to a given variable, or
return alternative values from a function. Often it is both
convenient and clear to use a ?: expression rather than cast the code
into the form of an "if" statement.
More information about the Comp.lang.c
mailing list