View difference between Paste ID: 4FeLdWPV and 8kX75Fz6
SHOW: | | - or go back to the newest paste.
1
#include <iostream>
2
3
using namespace std;
4
5
class Dot
6
{
7
8
private:
9
	
10
11
public:
12
	float x;
13
	float y;
14
	
15
	
16
Dot(float X, float Y) : x(X), y(Y)
17
{
18
	x = X;
19
	y =Y;
20
}
21
~Dot()
22-
	void getPosition(){
22+
23-
		cout  <<"X: "<<x<<endl;
23+
	cout  << "Destructor called for Dot" << endl;
24-
		cout  <<"Y: "<<y<<endl;
24+
25-
	}
25+
26
};
27-
	void setPosition(float X, float Y) : x(X), y(Y) {
27+
28-
		x = X;
28+
29-
		y =Y;
29+
30-
	}
30+
31
	
32-
	void reflectX() {
32+
33-
		x = -x;
33+
34-
	}
34+
35
}