Error in code if i create dynamic object of derived class
#include<iostream>
using namespace std;
class Base
{
public:
Base()
{
cout<<"Base Class constructor"<<endl;
}
~Base()
{
cout<<"Base Class Destructor";
}
};
class Derived:Base
{
public:
Derived()
{
cout<<"Derived Class constructor"<<endl;
}
~Derived()
{
cout<<"Derived Class Destructor";
}
};
int main()
{
Base *bptr=new Derived;
return 0;
}
Aucun commentaire:
Enregistrer un commentaire