point.cpp

来自「一个指针的例子,C++语言,我在初学C++时写的,大家请多指教」· C++ 代码 · 共 26 行

CPP
26
字号
// Point.cpp: implementation of the Point class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Point.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Point::Point(int _x,int _y):x(_x),y(_y)
{

}

Point::~Point()
{

}
float Point::cal_dist(Point& pt)
{
	float x=float(this->x-pt.x);
	float y=float(this->y-pt.y);
	return (float)sqrt(x*x+y*y);
}

⌨️ 快捷键说明

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