home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv7.zip / VACPP / IBMCPP / tutorial / ICLCC / TUTOR2 / PERSON2.H < prev    next >
Text File  |  1995-05-10  |  987b  |  35 lines

  1. /*************************************************************************
  2.  
  3.  IBM(R) VisualAge(TM) C++ for OS/2(R), Version 3
  4.   - Collection Class Library -
  5.  
  6.  (C) Copyright IBM Corp. 1991, 1995.
  7.   - Licensed Material - Program-Property of IBM - All Rights Reserved.
  8.  
  9.  *************************************************************************/
  10.  
  11. #include <istring.hpp>
  12. #include <iglobals.h>
  13.  
  14. class Person {
  15.         String name;
  16. public:
  17.         Person(char* n) : name(n)  { }
  18.         Person(Person const & person) : name(person.name)  { }
  19.         Person& operator = (Person const & person) {
  20.           name = person.name;
  21.           return *this;
  22.         }
  23.  
  24.         IString const & getName() const {
  25.                 return (name);
  26.         }
  27.  
  28.        int operator .. (Person const& anOther)const {
  29.         return (name ==  ............);
  30.        }
  31. };
  32. inline int compare (Person const & p1, Person const & p2) {
  33.    return .......(p1........(), p2........());
  34. }
  35.