// 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 Base1
{
    public:
        Base1() { i = 0; }
        int i;
};

struct Base2
{
    public:
        Base2() { i = 0; }
        int i;
};

void Increment(Base1 *b) { b->i++; }

void Increment(Base2 b) { b.i++; }

int main()
{
    Base1 *b1 = new Base1();
    Base2 b2;
    Increment(b1);
    Increment(b2);
    cout << "b1 = " << b1->i << " and b2 = " << b2.i << endl;
    return 0;
}
