Thread: c++ query
View Single Post
Old 26-07-2007, 06:42 PM   #6 (permalink)
fannedman
Guest
 
Posts: n/a
Post Re: c++ query

hm... from what i gather i think the destructor is called when the object is being destroyed ,it is not called to destroy the object..

Quote:
Originally posted by abhi_10_20
surely no for 2nd one bcoz a base class pointer mainly lets us to access addresses of derived class objects only....
yes i'm aware of that. I'm sorry i didnt phrase the question properly.
What i actually want to do is create a simple base class and include a method say del() which destroys the object. Now this method del() when inherited should also be able to destroy the inherited object i.e del() method should be common to any inherited class without any modification, but now it seems the destructor does not delete the object...