comp.lang.c
[Top] [All Lists]

Re: Implementation-defined behaviour

Subject: Re: Implementation-defined behaviour
From: Willem
Date: Sat, 29 Mar 2008 20:35:44 +0000 UTC
Newsgroups: comp.lang.c

Herbert wrote:
) On Fri, 28 Mar 2008 20:43:45 UTC, CBFalconer <cbfalconer@xxxxxxxxx> 
) wrote:
)
)> Ioannis Vranos wrote:
)> > 
)> ... snip ...
)> > 
)> > int main(void) {
)> >         int x= 1;
)> >         somefunc( (x++, somefunc(x)) );
)> >         return 0;
)> > }
)> > 
)> > In the above, the expression (x++, somefunc(x)) is evaluated to 2,
)> > so I assume it is guaranteed that it will print "2".
)> 
)> Because that is using the comma operator.  However:
)
) Here is no comma operator in sight.

Look again.  Note the extra parens and the fact that somefunc() takes a
single parameter.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy