预增量和后增量之间的差异 [英] Difference between pre-increment and post-increment
本文介绍了预增量和后增量之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
x ++和++ x之间的区别;
x - 和 - x之间的区别;
Difference between x++ and ++x;
Difference between x-- and --x;
推荐答案
++ x是预增量和x ++是后增量,在第一个x中,在使用之前递增,在第二个x在使用之后递增。
这最容易用小程序
++x is pre-increment and x++ is post-increment that is in the first x is incremented before being used and in the second x is incremented after being used.
This is most easily demonstrated with a small program
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号
x - 和 - x之间的区别;
Difference between x-- and --x;
我原以为你可以修改我发布的程序找出,其中++是增量的 - 除了在类似庄园中的行为之外是减量。
I would have thought you could have modified the program I posted to find out, where ++ is increment -- is decrement, apart from that that act in a similar manor.
这篇关于预增量和后增量之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文