What happens to an address after delete operator has been applied to it in C++?

前端 未结 5 607
春和景丽
春和景丽 2020-12-19 09:51

If I delete a pointer as follows for example:

delete myPointer;

And, after that did not assign 0

5条回答
  •  臣服心动
    2020-12-19 10:16

    Definetly, no. The delete operation doesn't change the pointer itself - it frees the memory addressed by that pointer.

提交回复
热议问题