gpt4 book ai didi

c++ - 为什么调用 printf ("%p",这个);删除后;非法的?

转载 作者:太空狗 更新时间:2023-10-29 20:27:00 24 4
gpt4 key购买 nike

<分区>

The answerthis questionthis page这表示,为了让 delete this; 正确运行:

You must be absolutely 100% positively sure that no one even touches the this pointer itself after the delete this line. In other words, you must not examine it, compare it with another pointer, compare it with NULL, print it, cast it, do anything with it.

我不明白为什么触摸指针本身会导致问题。
有人可以给我解释一下吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com