31 lines
714 B
C++

#ifndef EXAMPLE34_CPOINT_H
#define EXAMPLE34_CPOINT_H
#include <iostream>
#include "Point.h"
class CPoint : public Point {
private:
int color;
public:
CPoint() : Point(), color(0) {
}
CPoint(int x1, int y1, int b) : Point(x1, y1), color(b) {
}
~CPoint() {
}
bool equal(Point& p) {
std::cout << "Method CPoint::equal(Point)" << std::endl;
return true;
}
bool equal(CPoint& cp) {
std::cout << "Method CPoint::equal(CPoint)" << std::endl;
if ( (this->x==cp.x) && (this->y == cp.y) && (this->color == cp.color))
return true;
else
return false;
}
};
#endif //EXAMPLE34_CPOINT_H