Code /* * person2.h * CIS 250 * David Klick * 2005-02-21 * 2010-10-13 modified to add corrections * * Demonstration of friends, copy constructor, * and operator overloading. */ #ifndef __PERSON_H_ #define __PERSON_H_ #include #include using std::ostream; using std::istream; using std::cout; using std::cin; using std::endl; // you might have to declare these in some compilers: //class person2; //ostream& operator<<(ostream& strm, const person2& p); //istream& operator>>(istream& strm, const person2& p); class person2 { private: static int count; char* name; long ssn; char gender; int age; public: static const int MINIMUM_AGE = 0; static const int MAXIMUM_AGE =110; private: void init(const char* name, const long ssn, const char gender, const int age); public: person2(); person2(const char* name, const long ssn, const char gender, const int age); person2(const person2& p); ~person2(); void setName(const char* name); void setSSN(const long ssn); void setGender(const char gender); void setAge(const int age); const char* getName() const; long getSSN() const; int getAge() const; char getGender() const; static int getCount(); person2& operator=(const person2& p); bool operator==(const person2& p) const; friend ostream& operator<<(ostream& strm, const person2& p); friend istream& operator>>(istream& strm, person2& p); }; #endif