LearningMasteringAlgorithms-C
LearningMasteringAlgorithms-C copied to clipboard
在MSVC下部分代码提示报错。
原来的代码是:
heap.cpp
heap->tree = temp
改成
heap->tree = &temp;;//error:temp
这样才不会报错。
这样修改的话在Mac上是不行的,不知道是不是因为cpp的问题,因为tree->temp 本来就是一个指向实际内容的指针的指针,所以用heap->tree = temp应该是对的
在MSVC上的报错是什么呢?
报错为:a value of type "void *" cannot be assigned to an entity of type "void **". 可能是编译器的理解方式不同,暂时没有深入研究。