loop's counter i as I++ vs. i+1 as position in an array

前端 未结 7 1474
甜味超标
甜味超标 2021-01-13 23:25

I\'ve made a loop with i as it\'s counter variable.
Inside that loop I\'m comparing cells of an array.
I\'m wondering what\'s the difference between array[i++] (or a

7条回答
  •  春和景丽
    2021-01-13 23:27

    array[i++] means "take the array element with index i, then increment i". array[i+1] means "take the array element with index i+1, do not modify i".

提交回复
热议问题