【发布时间】:2021-02-03 08:15:25
【问题描述】:
当我们在这里减少代码时会发生什么:
temp[--countArray[getDigit(position, input[tempIndex], radix)]]
如果在这种情况下 temp 为 1:我们是否首先递减以便分配为 0?这种减少有多迅速?它似乎总是让我在数组括号中感到困惑。
【问题讨论】:
-
它递减
countArray[getDigit(position, input[tempIndex], radix)]并将递减的值用作temp的索引。 -
"如果在这种情况下 countArray 为 1"—
countArray不能为 1。它必须是一个数组。 -
@khelwood 我的错误,意思是写'if temp index is 1'