#include <iostream>
#include <fstream>
#include <climits>
#include <cstring>

int 
main()
{
  unsigned        Px = (unsigned)-1;
  double          Py = -1;
  char           *Ps = new char[1];
  Ps[0] = 0;
  while (true)
  {
    unsigned        X;
    double          Y;
    char           *S;
    fstream         f;
f.open("liczba.bin", ios: : in | ios: :binary);
    f.read((char *)&X, sizeof(X));
    f.read((char *)&Y, sizeof(Y));

    unsigned        DL;
    f.read((char *)&DL, sizeof(DL));
    S = new char    [DL + 1];
    f.read(S, DL);
    S[DL] = 0;

    f.close();
    if ((X == Px) && (Y == Py) && (!strcmp(S, Ps)))
      continue;
    cout << "X=" << X << " Y=" << Y << " S=" << S << endl;
    Px = X;
    Py = Y;
    delete[] Ps;
    Ps = S;
  }
  delete[] Ps;
  return 0;
}

