C++ delete - It deletes my objects but I can still access the data?

前端 未结 13 2131
礼貌的吻别
礼貌的吻别 2020-11-21 06:11

I have written a simple, working tetris game with each block as an instance of a class singleblock.

class SingleBlock
{
    public:
    SingleBlock(int, int)         


        
13条回答
  •  耶瑟儿~
    2020-11-21 07:04

    delete deallocates the memory, but does not modify it or zero it out. Still you should not access deallocated memory.

提交回复
热议问题