在尝试编译以下代码时,我收到了错误消息参数2没有已知的转换从long unsigned int
到long unsigned int&
:
void build(int* &array, unsigned long& index) {
if (index == 0)
return;
else {
heapify(array, index);
build(array, index-1);
}
}
可以有人解释一下为什么会发生这种情况,以及这个错误背后的逻辑是什么?
build(array,index-1);
上。 - ihm