home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_11 / splash / assoc.cpp next >
Text File  |  1993-01-15  |  560b  |  25 lines

  1. #ifdef    TESTASSOC
  2.  
  3. #include <iostream.h>
  4. #include "splash.h"
  5. #include "assoc.h"
  6.  
  7. main()
  8. {
  9.     Assoc<int> a;
  10.     a("one")= 1; a("two")= 2; a("three")= 3;
  11.     cout << a << endl;
  12.     
  13.     cout << "Keys:" << endl << a.keys() << endl;
  14.     cout << "Values:" << endl << a.values() << endl;
  15.     
  16.     cout << "a.isin(\"three\")= " << a.isin("three") << endl;
  17.     cout << "a.isin(\"four\")= " << a.isin("four") << endl;
  18.     
  19.     int t= a.adelete("two");
  20.     cout << "a.adelete(\"two\") returns: " << t << ", a= " << endl << a << endl;
  21.  
  22. }
  23. #endif
  24.  
  25.