You are on page 1of 2

class Point {

int _x, _y; // point coordinates


public: // begin interface section
void setX(const int val);
void setY(const int val);
int getX() { return _x;
int getY() { return _y;
;
Point apoint;
void Point::setX(const int val) {
_x ! val;

void Point::setY(const int val) {
_y ! val;

apoint"setX(#); // $nitiali%ation
apoint"setY(#);
void Point::setX(const int val) {
t&is'(_x ! val; // )se t&is to reference invo*ing
// ob+ect

void Point::setY(const int val) {
t&is'(_y ! val;

,onstructors
class Point {
int _x, _y;
public:
Point() {
_x ! _y ! -;

void setX(const int val);
void setY(const int val);
int getX() { return _x;
int getY() { return _y;
;
class Point {
int _x, _y;

public:
Point() {
_x ! _y ! -;

Point(const int x, const int y) {
_x ! x;
_y ! y;


void setX(const int val);
void setY(const int val);
int getX() { return _x;
int getY() { return _y;
;
Point apoint; // Point::Point()
Point bpoint(#., /0); // Point::Point(const int, const int)
class Point {
int _x, _y;

public:
Point() {
_x ! _y ! -;

Point(const int x, const int y) {
_x ! x;
_y ! y;

Point(const Point 1fro2) {
_x ! fro2"_x;
_y ! fro2"_y;


void setX(const int val);
void setY(const int val);
int getX() { return _x;
int getY() { return _y;
;
Point bpoint(apoint); // Point::Point(const Point 1)
Point cpoint ! apoint; // Point::Point(const Point 1)
3Point() { /4 5ot&ing to do6 4/

You might also like