// GuestFileCreation.C

#include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <errno.h>
#include "GuestInfoFixed.h"
#include "IODetails.h"

main()
{
  cout << "Guest File Creation" << endl;

  const char dbname[] = "guestDB.txt";

  ofstream outFile(dbname,
   	      ios::out | ios::noreplace);

  if (!outFile) {
    cerr << "Cannot open " << dbname
         << ": " << strerror(errno)
         << endl;
    return 1;
  }

  GuestInfoFixed blankGuest
    = {"", "", 0, 0.0};

  const int MAX_ROOM_NUM = 99;
  int i;
  for (i = 0; i <= MAX_ROOM_NUM; i++) {
    outFile.write((char*)&blankGuest,
		  sizeof(GuestInfoFixed));
  }

  return 0;
}
