추가내용

    C++ 클래스 접근제한자 관련 보충 내용

    클래스 접근제한자는 오브젝트 레벨이 아닌 클래스 레벨로 작동되기 때문에 생성자 내에서 파라미터로 받는 같은 클래스 변수의 private 또는 protected 멤버 변수에 접근이 가능하다. #include using namespace std; class A { private: int mValue = 0; public: A() = default; A(int val) : mValue(val) { } A(const A& a) { this->mValue = a.mValue; } void Print() { cout