This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About a paradox of post increment operator


ååå wrote:
> Hi, all
> 
> I am not sure whether this is a proper place to put up with my
> question. But I think you can answer my question.
> 
> See following two clauses
> 
> int x=20, y=35, z;
> 
> case 1: x = x++ + y++;
> case 2: z = x++ + y++;
> 
> in case 1. the result is x = 36;
> in case2:  the result is z = 35;
> 
> Whether this is a paradox for post increment operator ?
> 

comp.lang.c FAQ applies.  case 1 invokes Undefined Behavior.    For case
2, stuff you haven't shown must be affecting your result.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]