#include <iostream>
using namespace std;

struct A {
	virtual void f(int a=1) = 0;    
};
struct B:A {
	void f(int a) override ;     
};
struct C:A {
	void f(int a=2) override ;     
};
void B::f(int a)        // definition 
{
	cout<<"B"<<a<<endl; 
}
void C::f(int a)        // definition 
{
	cout<<"C"<<a<<endl; 
}
int main() {
	B b; 
	C c; 
	A *x=&c, *y=&b;    // points to the same objects but using a polymorphic pointer
	x->f();  // default value defined for A::f() but with the implementation of C ==> C1   
	y->f();  // default value defined for A::f() but with the implementation of B ==> B1
//	b.f();  // default not defined for B::f();   
	c.f();  // default value defined for C::f(); ==> C2
	return 0;
}