📄 subobject.h
字号:
#ifndef SUBOBJECT_H#define SUBOBJECT_H#include <iostream>using namespace std;//startclass Point { public: Point(int xx, int yy) : m_x(xx), m_y(yy){} ~Point() { cout << "point destroyed: (" << m_x << "," << m_y << ")" << endl; } private: int m_x, m_y;};class Square { public: Square(int ulx, int uly, int lrx, int lry) : m_UpperLeft(ulx, uly), m_LowerRight (lrx, lry) /* Member initialization is required here because there is no default ctor. */ {} Square(const Point& ul, const Point& lr) : m_UpperLeft(ul), m_LowerRight(lr) {} /* Initialize members using the implicitly generated Point copy ctor. */ private: Point m_UpperLeft, m_LowerRight; /* embedded subobjects */};//end#endif // #ifndef SUBOBJECT_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -