멤버 함수1 friend private로 선언된 class 변수를 외부에서 조작 하기 위해 사용. #include class AAA { int n; public: // SetN이라는 함수에 대해서 friend 선언 friend void SetN( AAA& a, int n ); void PrintN() { std::cout 2010. 3. 21. 이전 1 다음