Program below doesn't compile for obvious reasons:
#include <iostream>
using namespace std;
class A {
public:
A() { pVirt(); }
virtual void pVirt() const = 0 { count<<"A::pVirt()"; }
};
int main() {
A aObj;
aObj.pVirt();
reutrn 0;
}
Questions: 1. 0 in signature "virtual void pVirt() const = 0" means what?, Is this indicates NULL memory offset in vtable or just a syntax constraint?
- If 0 is NULL memory offset (if in case it is so) then why VC++ doesn't allow to specify another memory address, and is this the reason why we can't call pure virtual function from outside constructor (MAY BE because vtable is created after an object is fully constructed.)?