Tuesday, February 06, 2007

You can override new and delete for a certain class. So your operators will be called only if that class (or its derived classes) is being dynamically allocated. You can also override the global new and delete so your operators will be called on any dynamic allocation that occurs in your program.

For class based:For some classes you might need to allocate them on a certain memory location (like video memory or a shared memory area, I don't know if you might need that on a memory-mapped file or not.)

Question:

How to override it then?

Answer:

This is just example code to show you how you can do it, not how you should do it.

About us

We are a group of bloggers from Faculty of Computers & Information, Helwan University. We have a passion for technology, enjoy programming and we enjoy blogging. This blog is the result of combining those skills and the desire to share our knowledge with others.