This is what I think the ++
operator does
a++; // a+=1 after calculating this line
++a; // a+=1 before calcuating this lin
Don't do this. The behavior is undefined.
From the C spec (section 6.5)...
Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored.
Except as indicated by the syntax or otherwise specified later (for the function-call operator () , && , || , ?: , and comma operators), the order of evaluation of subexpressions and the order in which side effects take place are both unspecified.
In other words, if you update the value of a variable multiple times in the arguments for a function, you're not writing legal C code.