home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_C
/
CL187A.ZIP
/
EXAMP201.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-15
|
601b
|
30 lines
// Container Lite (CL v 1.87a)
// (C) Copyright John Webster Small 1994
// All rights reserved
// examp201.cpp -- link with cl.obj
#include <stdlib.h> // rand(), srand()
#include <time.h> // time_t, time()
#include "cl.h"
CL_WELL_ENDOWED(int)
#define intFile "ints.tmp"
main()
{
time_t t;
srand((unsigned) time(&t));
CL<int> ci(CL_ANDS,15);
int i = 0;
while (ci.atInsNew(rand()%(ci.Nodes()+1),&i))
i++;
ci.save(intFile);
ci.allClr();
ci.load(intFile);
cout << "0-14 in random order: " << endl;
while (ci.atDelAsg(0,&i))
cout << i << endl;
return 0;
}