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

using namespace std;

class myofstream : public ofstream {
    public:
        myofstream(char *fnm) : ofstream(fnm) { }
        void helloworld() { *this << "Hello world !" << endl; }
};

int main()
{
   myofstream f("z.dat");
   f << "Linie 1" << endl;
   f.helloworld();
   f << "Linie 3" << endl;
   return 0;
}
