Programming tricks related to ActionScript, Python, C/C++ and Java. See the comments for answers.
The C specification does not say whether post/pre-increment/decrementare evaluated before the particular variable access or before theexpression access. Apperantly the compiler evaluated a++ inline forint (and long), and evaluated a++ before the expression for short (and char).For int, it became: (a++)-(--a), which is ((a1=a,a=a1+1,a1)-(a=a-1)), left to right.For short, it became: (b=((a1=a)-(a=a-1)),a=a1+1,b) left to right.Note how a=a1+1 step is either in first part or after evaluating thewhole expression.
Post a Comment