// 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 C
{
    private:
        static int clsfld;
        int insfld;
    public:
        static void SetClsFld(int v);
        static int GetClsFld();
        void SetInsFld(int v);
        int GetInsFld();
};

int C::clsfld;

void C::SetClsFld(int v)
{
    clsfld = v;
}

int C::GetClsFld()
{
    return clsfld;
}

void C::SetInsFld(int v)
{
    insfld = v;
}

int C::GetInsFld()
{
    return insfld;
}

int main()
{
    C::SetClsFld(77);
    cout << C::GetClsFld() << endl;
    C o;
    o.SetInsFld(88);
    cout << o.GetInsFld() << endl;
    C *p = new C();
    p->SetInsFld(99);
    cout << p->GetInsFld() << endl;
    delete p;
    return 0;
}
