SPY 썸네일형 리스트형 [C++](example) class 생성/ friend/ spy 용용 #include using namespace std; class Point { double x; double y; static int countCreatedObjects; public: Point(); Point(int x, int y); void setPoint(int x, int y); int getX(void) const; int getY(void) const; static int getCreatedObject(void); Point operator+ (const Point& point); Point& operator= (const Point& point); friend ostream& operatory = y; countCreatedObjects++; } void Point::setPoint.. 더보기 [C++] class 생성/ friend / spy #include using namespace std; class Point { private: int x; int y; static int cntObj; // int* list; // ofstream fout; public: Point():x(0),y(0){ // list = new int[100]; // fout.open("file.txt"); cntObj++; } //default Point(int _x,int _y) : x(_x),y(_y) { cntObj++; } ~Point(){ cout 더보기 이전 1 다음