Hi All,
I am sharing with you all a problem . The problem is as follow
class baseClass {
public :
~baseClass() { cout<< "baseClass Des called"<< endl; }
};
/*Derived class*/
class derivedClass1 : public baseClass {
public:
*virtual *~derivedClass1() {cout <<"derivedClass1 Des called"<< endl;}
};
/*Derived class*/
class derivedClass2 : public baseClass {
public:
~derivedClass2() {cout <<"derivedClass2 Des called"<< endl;}
};
int main() {
baseClass *bPtr = new derivedClass2();
delete bPtr;
}
Can anyone tell me what will be the output and why ?
Note: the virtual destructor in derivedClass1.
--
Thanks and Regards
Deepak Kumar
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.