// 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>
#include <vector>
#include <string>

using namespace std;

class BC
{
public:
    virtual void print() = 0;
};

class SC1 : public BC
{
public:
    virtual void print() { cout << "I am a one" << endl; };
};

class SC2 : public BC
{
public:
    virtual void print() { cout << "I am a two" << endl; };
};

class SC3 : public BC
{
public:
    virtual void print() { cout << "I am a three" << endl; };
};

vector<BC*> init()
{
    vector<BC*> res;
    res.push_back(new SC1());
    res.push_back(new SC1());
    res.push_back(new SC3());
    res.push_back(new SC2());
    return res;
}

int main()
{
   vector<BC*> v = init();
   for(int i=0;i<v.size();i++) v[i]->print();
   return 0;
}
