what does x— or x++ do here?

后端 未结 7 1253
猫巷女王i
猫巷女王i 2021-01-23 01:53

it is a silly Q for most of u - i know - but i one of the beginner here, and I can not understand why the output in here are 12 what does this (x--) do to the resu

7条回答
  •  孤独总比滥情好
    2021-01-23 02:42

    Just a cautionary note, sometimes the pre and post increment operators can have unexpected results

    Why does this go into an infinite loop?

    and what does:

    x[i]=i++ + 1;
    

    do

    Read here: http://www.angelikalanger.com/Articles/VSJ/SequencePoints/SequencePoints.html

提交回复
热议问题