Here's the format of the code:
class C
{
public:
C();
virtual ~C() = 0;
};
class D : public C
{
public:
D();
~D();
};
C::C(){
}
C::~C(){
}
D::D(){
}
D::~D(){
}
int main(){
C *c = new C();
D *d = new D();
return 0;
}
When I try to instantiate c
I get the following error:
1>c:\main.cpp(59): error C2259: 'C' : cannot instantiate abstract class
I know I cannot call the virtual destructor, but there is something terribly I don't know on the concepts. Can someone explain me?