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

  1. //  \EXAMPLES\EX08062.H
  2. //  definition of classes PhoneNum
  3. //--------------------------------------------------------------
  4.  
  5. //  files in this example:
  6. // %F,15,EX08061.H%EX08061.H       definition of class String
  7. // EX08062.H       this file
  8. // %F,15,EX08063.H%EX08063.H       definition of List and ListIter
  9. // %F,15,EX08064.H%EX08064.H       definition of class PhoneBk
  10. // %F,15,EX08061.CPP%EX08061.CPP     member functions of class String
  11. // %F,15,EX08062.CPP%EX08062.CPP     member functions of 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 PhoneNum
  14. // %F,15,EX0806.CPP%EX0806.CPP    main to exercise PhoneBk class
  15. //--------------------------------------------------------------
  16. #ifndef PHONENO_H
  17. #define PHONENO_H
  18.  
  19. //--------------------------------------------------------------
  20. #include "EX08061.H"
  21.  
  22. //--------------------------------------------------------------
  23. // definition of a class PhoneNum,
  24. //     each object is a name and phone number
  25. //--------------------------------------------------------------
  26. class PhoneNum {
  27.   String name;
  28.   long tel;
  29. public:
  30.   PhoneNum() {};
  31.   PhoneNum( char* n, long tn ) : name (n), tel(tn) {};
  32.   ~PhoneNum() {};
  33.   void change ( long tn) { tel = tn; };
  34.   long gettel() { return tel; };
  35.   int compare (char* who) { return name.compare (who); };
  36.   ostream& print(ostream& os);
  37. };
  38.  
  39. //--------------------------------------------------------------
  40. #endif
  41. //--------------------------------------------------------------
  42.