Operator 'new' - dynamic memory allocation

I don't really have a specific example, but I have been learning about the 'new' operator and I'm a little worried about what I've been reading. I know that you're supposed to do something like this:

1
2
example *object = new example;
delete object;


and delete the object explicitly or it would result in a memory leak. The first time I did this I didn't delete the objects and now I'm wondering about the effects of it. Would this memory leak only occur inside the application or would it effect my entire system?
Only inside your application.
When your application allocates a memory, the OS knows it. And when the application ends, OS can automatically delete all the memory your application has allocated.
Would occur only within your application and would not affect the system, assuming you're working on a modren memory protected operating system.
Topic archived. No new replies allowed.