명품 C++ programming 실습 문제 7장 8번
문제 : 원을 추상화한 Circle 클래스는 간단히 아래와 같다. 1 2 3 4 5 6 class Circle{ int radius; public: Circle(int radius=0) { this->radius = radius; } void show() { cout « “radius = " « radius « " 인 원” « endl; } }; 다음 연산이 가능하도록 연산자를 프렌드 함수로 작성하라. 1 2 3 4 5 Circle a(5), b(4); ++a; // 반지름을 1 증가 시킨다. b = a++; // 반지름을 1 증가 시킨다. a.show(); b.show(); 실행 결과 : ...