subobject.h
来自「压缩包里有教材<<C++模式设计-基于QT4开源跨平台开发框架>」· C头文件 代码 · 共 34 行
H
34 行
#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 + =
减小字号Ctrl + -
显示快捷键?