How to call destructor of derived class
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
If I have a base class pointer & want to call the Destrutor of the dervied class. How do i do that ?
Vikas Amin EATON PUNE
-
If I have a base class pointer & want to call the Destrutor of the dervied class. How do i do that ?
Vikas Amin EATON PUNE
Make ur destructor virtual and just use delete operator on base class pointer. U can also call destructor manually using downcasting by converting base class pointer to derived class pointer.
Karnav Zaveri