// 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;

void test1(int v)
{
   v++;
}

void test2(int& v)
{
   v++;
}

void test3(int *v)
{
   (*v)++;
}

static int v123 = 123;

int test4()
{
   return v123;
}

int& test5()
{
   return v123;
}

int *test6()
{
   return &v123;
}

int main()
{
   int v = 0;
   test1(v);
   cout << v << endl;
   test2(v);
   cout << v << endl;
   test3(&v);
   cout << v << endl;
   cout << test4() << endl;
   cout << test5() << endl;
   cout << *(test6()) << endl;
   return 0;
}
