Google sequence points. The C Standard states that between the previous and
next sequence point an object shall have its stored value modified at most
once by the evaluation of an expression.
So, expressions like i++ + ++i can produces different results on different
compilers. Its not a standard expression a per Standard.
On Wed, Jun 15, 2011 at 9:47 AM, Bhavesh agrawal <agr.bhav...@gmail.com>wrote:

>
>
> int a,c=5;
> a=c++ + ++c + c++ + ++c;
> printf("%d\n",a);
> c=5;
> a=c++ + ++c + c++;
> printf("%d\n",a);
> c=5;
> a=++c + ++c;
> printf("%d\n",a);
> c=5;
> a=++c + ++c + ++c;
> printf("%d\n",a);
>
> compiled with gcc and the outputs are
> 25
> 18
> 14
> 22
>  can anyone plz explain these outputs
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Harshal Choudhary,
III Year B.Tech CSE,
NIT Surathkal, Karnataka, India.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to