Re: Same code and different result, Why?
- From: Ulrich Eckhardt <eckhardt@xxxxxxxxxxxxxx>
- Date: Fri, 07 Nov 2008 10:31:34 +0100
Tommy wrote:
In other words:
int x = 36; y = 20;
int t = x++ + y++;
x = t;
*SHOULD* yield the same results as:
int x = 36; y = 20;
x = x++ + y++;
I'd say the second one could as well be evaluated like this:
x = x + y;
++x;
++y;
Why should it be exactly as you say instead?
Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
.
- Follow-Ups:
- Re: Same code and different result, Why?
- From: sdiverdi
- Re: Same code and different result, Why?
- From: Tommy
- Re: Same code and different result, Why?
- References:
- Same code and different result, Why?
- From: Lorry Astra
- Re: Same code and different result, Why?
- From: Alex Blekhman
- Re: Same code and different result, Why?
- From: Tommy
- Same code and different result, Why?
- Prev by Date: Re: using const & in function prototypes
- Next by Date: Re: About assembly code generated for function calls (VS 2008)
- Previous by thread: Re: Same code and different result, Why?
- Next by thread: Re: Same code and different result, Why?
- Index(es):
Relevant Pages
|
Loading