Themuppeteer
Programmer
Who can tell me somthing about virtual destructors?
I need them but don't know how to use them.
eg.
I have an class called drawings;
Also I have a new class derived from drawings calls circle,and another class derived from drawings calls rectangle.
If I create an array of pointers to "drawings" , the destructor of the class drawings will be called,when I delete the array. I don't want that, because the array contains circles and rectangles. The only possible solution:virtual destructors.
Any help would be great.
thnx.
Greetz,
The Muppeteer.
themuppeteer@hotmail.com
Don't eat yellow snow...
I need them but don't know how to use them.
eg.
I have an class called drawings;
Also I have a new class derived from drawings calls circle,and another class derived from drawings calls rectangle.
If I create an array of pointers to "drawings" , the destructor of the class drawings will be called,when I delete the array. I don't want that, because the array contains circles and rectangles. The only possible solution:virtual destructors.
Any help would be great.
thnx.
Greetz,
The Muppeteer.
themuppeteer@hotmail.com
Don't eat yellow snow...