Using the post-increment in function arguments

后端 未结 5 980
忘了有多久
忘了有多久 2021-01-12 01:40

When I run this code, the output is 11, 10.

Why on earth would that be? Can someone give me an explanation of this that will hopefully enlighten me?

Thanks<

5条回答
  •  清歌不尽
    2021-01-12 02:01

    x++ is a function parameter and they may be evaluated in an unspecified order which means the behavior is undefined and not portable (or legal).

提交回复
热议问题