// // NAME // person.cpp // // DESCRIPTION // This file contains the function definitions for the member // functions of the person class and global functions which are // related to the person class. // // For descriptions of the parameters and return values, // see person.h. // // // Include files. // #include#include #include "bool.h" #include "person.h" // // NAME // person::person() // // DESCRIPTION // This is the default constructor for the person class. // person::person() { } // // NAME // person::person(const person& p) // // DESCRIPTION // This is the copy constructor for the person class. // person::person(const person& p) { strcpy(firstName, p.firstName); strcpy(lastName, p.lastName); age = p.age; } // // NAME // person::operator= // // DESCRIPTION // This is the assignment operator for the person class. // const person& person::operator=(const person& p) { if (this != &p) { strcpy(firstName, p.firstName); strcpy(lastName, p.lastName); age = p.age; } return *this; } // // NAME // operator<< // // DESCRIPTION // This is the output operator for the person class. // ostream& operator<<(ostream& os, const person& p) { os << endl; os << "First name: " << p.firstName << endl; os << "Last name: " << p.lastName << endl; os << "Age: " << p.age << endl; return os; } // // NAME // operator>> // // DESCRIPTION // This is the input operator for the person class. // istream& operator>>(istream& is, person& p) { cout << "Enter first name of person (up to " << firstNameLen << " characters): "; is >> p.firstName; cout << "Enter last name of person (up to " << lastNameLen << " characters): "; is >> p.lastName; cout << "Enter age of person (integer): "; is >> p.age; return is; } // // End of file. //