// 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:
      int v;
   public:
      C(int v);
      friend ostream &operator<<(ostream &out, const C &o);
};

C::C(int v)
{
   this->v = v;
}

ostream &operator<<(ostream &out, const C &o)
{
   out << o.v;
   return out;
}

int main()
{
   C test(123);
   cout << test << endl;
   return 0;
}
