class A{
int x;
public:
A(int p):x(p) { }
virtual void f1() const { }
};
class B: public A{
int y;
public:
B(int p, int q) : x(p), y(q) { }
virtual void f1() const { }
virtual void f3() const { }
};
int main() {
A *ptr = new B();
ptr -> f3();
return 0;
}
Options:
- runtime error
- compile-time error
- linker error
- No error, f3 will be called from class 8