home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / EXAMPLES / EX08064.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-01  |  1.8 KB  |  42 lines

  1. //  \EXAMPLES\EX08064.H
  2. //  definition of the class PhoneBk
  3. //--------------------------------------------------------------
  4.  
  5. //  files in this example:
  6. // %F,15,EX08061.H%EX08061.H       definition of class String
  7. // %F,15,EX08062.H%EX08062.H       definition of class PhoneNum
  8. // %F,15,EX08063.H%EX08063.H       definitions of List and ListIter
  9. // EX08064.H       this file
  10. // %F,15,EX08061.CPP%EX08061.CPP     member functions of class String
  11. // %F,15,EX08062.CPP%EX08062.CPP     member functions of the class PhoneNum
  12. // %F,15,EX08063.CPP%EX08063.CPP     member functions List and ListIter
  13. // %F,15,EX08064.CPP%EX08064.CPP     member functions of class PhoneBk
  14. // %F,15,EX0806.CPP%EX0806.CPP    main to exercise PhoneBk class
  15. //--------------------------------------------------------------
  16.  
  17. #ifndef PHONEBK_H
  18. #define PHONEBK_H
  19.  
  20. //--------------------------------------------------------------
  21. #include "EX08063.H"
  22.  
  23. //--------------------------------------------------------------
  24. // Definition of a class PhoneBk, each object is a phonebook.
  25. //--------------------------------------------------------------
  26. class PhoneBk {
  27.   List list;
  28.   int maxsize;                       // maximum number of entries
  29.   int numEntry;                      // number of entries so far
  30. public:
  31.   PhoneBk ();                        // default constructor
  32.   PhoneBk ( const PhoneBk& oldbook); // copy constructor
  33.   ~PhoneBk () {};                    // destructor
  34.   int insert( char* who, long telnum); // insert or change entry
  35.   int remove( char* who);            // remove entry for name
  36.   long lookup(char* who);            // look up number for name
  37.   ostream& print(ostream& os);       // print the phonebook
  38. };
  39.  
  40. //--------------------------------------------------------------
  41. #endif
  42.