home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / PBL30SAM.ZIP / BUCKTEST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-08  |  543 b   |  29 lines

  1. #include "bucket.h"
  2. #include "pbstruct.h"
  3. #include <iostream.h>
  4. #include <string.h>
  5.  
  6. void
  7. main()
  8. {
  9.     zBucket<FILECFG> bucket("FILECFG.PRO", 10, True);
  10.     FILECFG          area;
  11.     char             buf[200];
  12.     int              i;
  13.  
  14.     if( bucket )
  15.     {
  16.         cout << bucket.nelems() << " items in the file\n";
  17.  
  18.         for( i = 0; i < bucket.nelems(); ++i )
  19.         {
  20.             area = bucket[i];
  21.             sprintf(buf, "%3d. %s", i + 1, area.name);
  22.             cout << buf << endl;
  23.             strcpy(area.name, buf);
  24.             bucket[i] = area;
  25.         }
  26.         cout << "\n\ndone...\n";
  27.     }
  28. }
  29.