在0x00C87963处的未处理异常....:0xC0000005:访问冲突读取位置0xCCCCCCE0

Ole*_*siy 1 c++ null pointers exception

我不明白为什么会发生这样的错误:

while (currentNode != nullptr)
    currentNode = currentNode->parent;
Run Code Online (Sandbox Code Playgroud)

我的while循环的条件应该阻止它....

rod*_*igo 7

0xCCCCCCE0看起来很像0xCCCCCCCCVisualC++在调试版本中放入任何未初始化的局部变量.

所以我的猜测是你忘了设置nullptr你的currentNode或一些parent.