// 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>
#include <fstream>
#include <string>

using namespace std;

int main()
{
   cout << "-----------------" << endl;
   ifstream f1("test.dat");
   while(!f1.eof())
   {
      string date;
      int age;
      f1 >> date >> age;
      if(f1) 
      {
         cout << "| " << date << " | " << age << " |" << endl;
         cout << "-----------------" << endl;
      }
   }
   string date;
   int age;
   cout << "Enter date as dd.mm.yy and age: ";
   cin >> date >> age;
   ofstream f2("test.dat", ios::app);
   f2 << date << " " << age << endl;
   f2.close();
   return 0;
}
