CodePudding user response:
The same variable line of not more than + + and -CodePudding user response:
Can't use mathematical law, to use computer theorem,I just see the high-level data types, generally understand to,
In a computer, it is need you to define the data, and provide the data of operation,
Also said the operation rule of increment, is actually a language makers,
Developers of the language, mathematical law may apply, to realize the basic data types operating law,
May not be,
Your problem, for example, the C language standard, there is no definition of incremental meets the commutative law,
Your problem is undefined, the result depends on the realization of the compiler,
CodePudding user response:
Normal person wouldn't write write code,Who gave you the problem, you just said to him
CodePudding user response:
It belongs to undefined behavior for c/c + +K++ + + + k this kind of expression, plus ends who first, who is not explicitly set is calculated after the
In addition k++ this return value of intermediate variables, on the back of the k what is the effect of the same is undefined behavior
This is meaningless, the different compiler and platforms different answers