목록제휴관계 (1)
일상 코딩
[C++/10.04] 제휴 관계, Association
#include #include #include using namespace std; class Doctor; // forward declaration class Patient { private: string m_name; vector m_doctors; public: Patient(string name_in) : m_name(name_in) { } void addDoctor(Doctor *new_doctor) { m_doctors.push_back(new_doctor); } void meetDoctors(); friend class Doctor; }; class Doctor { private: string m_name; vector m_patients; public: Doctor(string name_..
C++/따배C++ 10강 객체들 사이의 관계
2021. 11. 3. 22:23