// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

class A {
   public:
      int va;
      A();
      virtual void f1() = 0;
};

class B : public A
{
    public:
       int vb;
       B();
       virtual void f1();
       void f2();
};

A::A()
{
    va = 123;
}

B::B()
{
    vb = 456;
}

void B::f1()
{
    cout << va << endl;
}

void B::f2()
{
    cout << vb << endl;
}

int main()
{
    B *b = new B();
    b->f1();
    b->f2();
    delete b;
    return 0;
}
