How to create a memory leak in C++?

前端 未结 10 1360
没有蜡笔的小新
没有蜡笔的小新 2020-12-30 00:35

I was just wondering how you could create a system memory leak using C++. I have done some googling on this but not much came up, I am aware that it is not really feasible t

10条回答
  •  感动是毒
    2020-12-30 01:17

    1. Create pointer to object and allocate it on the heap
    2. Don't delete it.
    3. Repeat previous steps
    4. ????
    5. PROFIT

提交回复
热议问题