Re: [gtk-list] Strange gcc behaviour



Well, first of all, this isn't the right list for your question.

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;
>
> (those are really COMMAS up there , NOT SEMICOLONS)
>

It's the way C works. It has to do with the difference between expressions and
statements. An assignment like a = b is an expression (to let yod do thingies
like
a = b = c;). You can separate expressions with commas in C.
You separate statements with semicolons.

Alfred

> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
>





--
Alfred Mickautsch --- mi@ugs.com
Baan & Schuler GmbH, Karl-Berner-Str. 4, D-72285 Pfalzgrafenweiler




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