C++ 9

[Absolute C++] Ch6-3

#include using namespace std; class Point { public: Point(); //디폴트 생성자 void set(); // 초기 좌표 값을 설정하는 멤버함수 void moveTo(); // 좌표 이동 멤버함수 void Rotate90(); // 원점 중심 90도 회전변환 멤버함수 void printPos(); // 현재 좌표를 출력해주는 멤버함수 private: int x; // 멤버변수, 좌표를 나타내는 x값과 y값 int y; }; int main() { Point point1; // 클래스 변수 선언시 인자가 없는 생성자를 호출할 때에는 괄호를 사용하지 않는다. cout y; } void Point::Rotate90() { //90도 회전변환 cos(-pi/2) = 0..

Code 2019.09.19