Nov 29, 2012 at 5:50am UTC
Like a constructor ...
Can a destructor be overloaded ?
Pls give reasons too...
Nov 29, 2012 at 5:52am UTC
No, destructors cannot be overloaded.
Nov 29, 2012 at 6:37am UTC
Okay..
And why is that..?
Is it not possible for a destructor to destruct in different ways..?
Nov 29, 2012 at 8:12am UTC
Yes, a destructor can be overloaded.
You should make the base destructor virtual. That guarantees that the destructors of all derived classes are called.
The destructor has of course only one form
~ClassName()
because it's called automatically
Nov 29, 2012 at 8:25am UTC
coder777: You're confusing overloaded and overridden.
Nov 30, 2012 at 4:36am UTC
coder777,
hmmm ...what exactly could be the use of that ...?
making it virtual ?
I don't think it classifies as "overloading"