point.cpp

来自「c++模板小实验」· C++ 代码 · 共 32 行

CPP
32
字号
//point.cpp
#include "point.h"
#include <iostream.h>
point::point(int a,int b)
{x=a;
 y=b;
 cout<<"创建点"<<x<<","<<y<<endl;
};
point::~point()
{cout<<"delect point!"<<endl;
};
void point::operator++()
{++x;
 ++y;
 cout<<x<<","<<y<<endl;
}
void point::operator++(int)
{x++;
 y++;
 cout<<x<<","<<y<<endl;
};
void point::operator--()
{--x;
 --y;
 cout<<x<<","<<y<<endl;
};
void point::operator--(int)
{x--;
 y--;
 cout<<x<<","<<y<<endl;
};

⌨️ 快捷键说明

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