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
A memory leak occurs when you call new without calling a corresponding delete later. As illustrated in this sample code:
new
delete
int main() { // OK int * p = new int; delete p; // Memory leak int * q = new int; // no delete }