Re: [NEWBIE] question

From: Daniel A. Koepke (
Date: 04/03/01

On Wed, 4 Apr 2001, Mysidia wrote:

>     Sample use:
>     foo = (0 ? a : c,b)
>     is the same as foo = c

No.  The value of the expression c,b is b, thus the value of that entire
expression is b, with the side-effect of binding the value of b to the
variable foo.  Throwing in the comma operator there seems sort of weird,
since you're trying to demostrate a simple use of the conditional
expression, not of the weird comma operator in C.  Suffice it to say,
however, that the comma operator always evaluates to the rightmost

  printf("%d\n", (1,2,3,4,5,6,7));



It's not particularly useful to know this.


   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/05/01 PST