Why doesn't deleting my pointer delete my pointer?

前端 未结 8 1613
悲哀的现实
悲哀的现实 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:05

    This code

    delete P1;
    
    cout<<"P1 = "<
                                                            
提交回复
热议问题