DragonFly BSD
DragonFly users List (threaded) for 2005-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: code understanding help


From: Mathieu Segaud <segaud@xxxxxxxxx>
Date: Sun, 03 Apr 2005 18:43:31 +0200
Cancel-lock: sha1:ctYwBjEiycXHu4+rPC/IBypRbII=

Terry Tree <terry.tree@xxxxxxxxx> writes:

> I'm trying to go through a book on programming in C and I'm having
> problem understanding the second example in the book.
>
> $cat 2.c 
>
> #define PRINTX printf("%d\n", x);
>
> int
> main(int argc, char *argv[])
> {
>     int x = 2, y, z;
>
>     x *= 3 + 2; PRINTX;

here the output is 10, right ?

>     x *= y = z = 4; PRINTX; // the output makes no sense

so here it becomes 40.

-- 
Mathieu Segaud



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]