home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX08032.H
- // modified implementation of the PhoneBk class
- //--------------------------------------------------------------
-
- // files in this example:
- // %F,15,EX08031.H%EX08031.H definition of class String
- // EX08032.H this file
- // %F,15,EX08031.CPP%EX08031.CPP member functions of String
- // %F,15,EX08032.CPP%EX08032.CPP member functions of PhoneBk
- // %F,15,EX0803.CPP%EX0803.CPP main() to exercise this class
-
- //--------------------------------------------------------------
-
- #ifndef PHONEBK_H
- #define PHONEBK_H
-
- #include <iostream.h> // for stream I/O
- #include "EX08031.H" // definition of class String
-
- //--------------------------------------------------------------
- // Definition of a class PhoneBk
- //--------------------------------------------------------------
-
- class PhoneBk {
- String names[100]; // room for 100 names
- long tel[100]; // room for 100 numbers
- int numEntry; // number of entries so far
- public:
- PhoneBk () { numEntry = 0; }; // default constructor
- PhoneBk ( const PhoneBk& oldbook); // copy constructor
- ~PhoneBk () {}; // destructor
- int insert( char* who, long telnum); // insert or change entry
- int remove( char* who); // remove entry for name
- long lookup(char* who); // look up number for name
- ostream& print(ostream& os); // print the phonebook
- };
-
- #endif
- //--------------------------------------------------------------
-