The problem of the return value of the self-increasing and self-subtracting operator in C language.

topic description


c

cC217

vs2017:
-sharpinclude
int main(){


}

5191215
4201015

expect the boss to give a reasonable explanation. Whether
is a problem with my compiler or not.

C
May.07,2022
Side effects of

expressions learn about


this is an undefined behavior.
if the parameters are evaluated from right to left, then the answer given by your compiler is correct. My compiler is also evaluated from right to left.


each question in the book is independent and not affected by each other;
but according to your code, the four questions will affect each other, and it is also related to the order of printf evaluation


results in my Macbook environment:

5 19 12 15
Menu