Is (--i == i++) an Undefined Behavior?

后端 未结 8 1967
离开以前
离开以前 2020-12-22 11:06

this question is related to my previous problem. The answer I got was \"It is an Undefined behavior.\"

Please anyone explain:

  • What is an undef
8条回答
  •  时光说笑
    2020-12-22 11:50

    Yes, that expression is undefined behavior as well (in C and C++). See http://en.wikipedia.org/wiki/Sequence_point for some information on the rules; you can also search for "sequence point" more generally (that is the set of rules that your code violates).

提交回复
热议问题