home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv7.zip / VACPP / IBMCPP / tutorial / ICLCC / TUTOR6 / PERSON6.H < prev    next >
Text File  |  1995-05-10  |  990b  |  39 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() : name()  { }
  18.         Person(char* n) : name(n)  { }
  19.         Person(Person const & person) : name(person.name)  { }
  20.         Person& operator = (Person const & person) {
  21.           name = person.name;
  22.           return *this;
  23.         }
  24.  
  25.         char* getName() const {
  26.                 return (name);
  27.         }
  28.  
  29.     int operator . (const Person& anOther)const {
  30.       return ( name . anOther.name);
  31.     }
  32.  
  33.     int operator .. (const Person& anOther)const {
  34.       return (name .. anOther.name);
  35.     }
  36. };
  37.  
  38.  
  39.