home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX08062.H
- // definition of classes PhoneNum
- //--------------------------------------------------------------
-
- // files in this example:
- // %F,15,EX08061.H%EX08061.H definition of class String
- // EX08062.H this file
- // %F,15,EX08063.H%EX08063.H definition of List and ListIter
- // %F,15,EX08064.H%EX08064.H definition of class PhoneBk
- // %F,15,EX08061.CPP%EX08061.CPP member functions of class String
- // %F,15,EX08062.CPP%EX08062.CPP member functions of class PhoneNum
- // %F,15,EX08063.CPP%EX08063.CPP member functions List and ListIter
- // %F,15,EX08064.CPP%EX08064.CPP member functions of class PhoneNum
- // %F,15,EX0806.CPP%EX0806.CPP main to exercise PhoneBk class
- //--------------------------------------------------------------
- #ifndef PHONENO_H
- #define PHONENO_H
-
- //--------------------------------------------------------------
- #include "EX08061.H"
-
- //--------------------------------------------------------------
- // definition of a class PhoneNum,
- // each object is a name and phone number
- //--------------------------------------------------------------
- class PhoneNum {
- String name;
- long tel;
- public:
- PhoneNum() {};
- PhoneNum( char* n, long tn ) : name (n), tel(tn) {};
- ~PhoneNum() {};
- void change ( long tn) { tel = tn; };
- long gettel() { return tel; };
- int compare (char* who) { return name.compare (who); };
- ostream& print(ostream& os);
- };
-
- //--------------------------------------------------------------
- #endif
- //--------------------------------------------------------------
-