Why doesn't deleting my pointer delete my pointer?

前端 未结 8 1622
悲哀的现实
悲哀的现实 2021-02-13 04:22

So to understand new/delete better (really to prove to myself with small examples why virtual destructors are needed for interfaces), I want to understand memory leaks, so that

8条回答
  •  渐次进展
    2021-02-13 05:21

    The memory is freed but it is not cleaned. The value may stay in memory until some other process writes a new value in that location.

提交回复
热议问题