why we should implement pure virtual function in this case?
My code:
class A
{
public:
A(){}
A(int _a) : a(_a){}
virtual ~A() = 0;
private:
int a;
};
class B : public A
{
public:
B(){}
B(int _a):A(_a){}
~B(){}
private:
};
I declare B b;, then when i compile this program, i met this error:
error LNK2019: unresolved external symbol "public: virtual __thiscall
A::~A(void)" (??1A@@UAE@XZ) referenced in function "public: virtual
__thiscall B::~B(void)" (??1B@@UAE@XZ)
I want to know, Do we need implement the pure virtual function all the time?
No comments:
Post a Comment