hour08_1a.hpp
来自「《24学时精通c++》的随书源码的下半部分。欢迎下载学习。」· HPP 代码 · 共 46 行
HPP
46 行
// Begin rect.hpp
// You will need to rename this file to rect.hpp
#include <iostream>
// point has been removed to its own file:
#include "point.hpp"
class Rectangle
{
public:
Rectangle (int top, int left, int bottom, int right);
~Rectangle () {}
int GetTop() const { return itsTop; }
int GetLeft() const { return itsLeft; }
int GetBottom() const { return itsBottom; }
int GetRight() const { return itsRight; }
Point GetUpperLeft() const { return itsUpperLeft; }
Point GetLowerLeft() const { return itsLowerLeft; }
Point GetUpperRight() const { return itsUpperRight; }
Point GetLowerRight() const { return itsLowerRight; }
void SetUpperLeft(Point Location);
void SetLowerLeft(Point Location);
void SetUpperRight(Point Location);
void SetLowerRight(Point Location);
void SetTop(int top);
void SetLeft (int left);
void SetBottom (int bottom);
void SetRight (int right);
int GetArea() const;
private:
Point itsUpperLeft;
Point itsUpperRight;
Point itsLowerLeft;
Point itsLowerRight;
int itsTop;
int itsLeft;
int itsBottom;
int itsRight;
};
// end Rect.hpp
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?