#include "Man.h" Man::Man(const string& name, const string& address, const string& email, const string& tel, const int age) { this->name = new string(name); this->address = new string(address); this->email = new string(email); this->tel = new string(tel); this->age = age; } Man::Man(const Man& m) { this->name = new string(*m.name); this->address = new string(*m.address); this->email = new string(*m.email); this->tel = new string(*m.tel); this->age = m.age; } Man::~Man() { delete name; delete address; delete email; delete tel; } string Man::toString() { string newName = string("À̸§: ") + (*name); string newAddress = string("ÁÖ¼Ò: ") + (*address); string newEmail = string("À̸ÞÀÏ: ") + (*email); string newTel = string("ÀüÈ­¹øÈ£: ") + (*tel); string newAge = string("³ªÀÌ: ") + (age < 0 ? "null" : age); return newName + newAddress + newEmail + newTel + newAge; } ostream& operator<<(ostream& out, const Man& m) { return out << m.toString(); } Man& Man::operator=(const Man& m) { delete name; delete address; delete email; delete tel; this->name = new string(*m.name); this->address = new string(*m.address); this->email = new string(*m.email); this->tel = new string(*m.tel); this->age = m.age; return *this; } void Man::setName(const string& newName) { delete name; name = new string(newName); } void Man::setAddress(const string& newAddress) { delete address; address = new string(newAddress); } void Man::setEmail(const string& newEmail) { delete email; email = new string(newEmail); } void Man::setTel(const string& newTel) { delete tel; tel = new string(newTel); } void Man::setAge(int newAge) { age = newAge; } string Man::getName() { return *name; } string Man::getAddress() { return *address; } string Man::getEmail() { return *email; } string Man::getTel() { return *tel; } int Man::getAge() { return age; }