i— and i = i-1 not evaluating the same

后端 未结 4 1465
太阳男子
太阳男子 2021-01-29 04:48

I thought that i-- is a shorthand for i = i - 1, but I discovered that both evaluate different:

         


        
4条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 05:26

    You should use --ias the pre-decrement operator.

    See the docs here

提交回复
热议问题