⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d-point.h

📁 一些学习c++的例题
💻 H
字号:
#ifndef __POINT_H__
#define __POINT_H__

struct CPoint
{
   int x, y;

   CPoint(const int xx = 0, const int yy = 0) : x(xx), y(yy) {}
   CPoint(const CPoint& p) : x(p.x), y(p.y) {}
   ~CPoint() {}

   CPoint& operator=(const CPoint& p)
   {
      x = p.x;
      y = p.y;
      return *this;
   }

   CPoint& operator+=(const CPoint& p)
   {
      x += p.x;
      y += p.y;
      return *this;
   }

   CPoint& operator*=(const float s)
   {
      float t1 = x * s, t2 = y * s;
      x = int(t1);  y = int(t2);
      return *this;
   }
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -