Re: [gtk-list] Strange gcc behaviour
- From: James Gardiner <jamgard sprintmail com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Strange gcc behaviour
- Date: Fri, 7 Aug 1998 03:17:16 -0400
On Fri, Aug 07, 1998 at 03:41:04PM +0930, O'CONNOR, Steve wrote:
> just a quick one ...
>
> why does this work ?
>
> int a,b,c;
>
> a = 56 + 3,
> b = 29 * 2,
> c = a * 2;
>
The comma operator separates related operations in a compact expression. If
you were to write instead:
int a,b,c,d;
d = (a = 56 + 3,
b = 29 * 2,
c = a * 2);
The value of d would be 118 (a * 2) because the value of a comma separated
expression is the value of the rightmost expression.
Had to look it up,
James Gardiner
BTW, does this *really* belong on the GTK+ mailing list? :)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]