C++ deleting a pointer to a pointer

前端 未结 7 573
猫巷女王i
猫巷女王i 2020-12-24 14:41

So I have a pointer to an array of pointers. If I delete it like this:

delete [] PointerToPointers;

Will that delete all the pointed to po

7条回答
  •  旧巷少年郎
    2020-12-24 15:26

    Pointers are pretty much just memory references and not spiffy little self-cleaning .net objects. Creating proper destructors for each class will make the deletion a little cleaner than massive loops throughout the code.

提交回复
热议问题