Dynamic massive

What if after this
int *p=new int[7];
I forget to write delete[] p;
Will it harm my computer after a while, or will it delete itself after a while?

It causes memory leaks, which, to my understanding are released after the program ends, but it is very bad as it causes unnecessary stress on the computer program execution as it is holding onto variables you don't even need anymore.
It's similar to handing a stranger your new born baby, and telling him you'll be right back to pick it up, but you run away and never look back.
i.e. computer has to make an effort to remove that memory?
At the end of your program, all that memory will be released, so yes the computer WILL take care of it, but if you have a very long program, and a lot of memory leaks, you are essentially making it do extra work for nothing.
Thank you
Topic archived. No new replies allowed.