123456789101112131415161718192021222324252627282930313233343536 |
- #include "Point.h"
- #include <fstream>
- //METHODS
- //constructor
- Point::Point(double x, double y)
- {
- m_x = x;
- m_y = y;
- }
- bool Point::operator==(const Point& other) const
- {
- if (m_x == other.m_x && m_y == other.m_y)
- {
- return true;
- }
- return false;
- }
- std::ostream& operator<<(std::ostream& os, const Point& point)
- {
- os << " x= " << point.m_x << " y= " << point.m_y;
- return os;
- }
- Point& operator>>(std::ifstream& is, Point& point)
- {
- char buff[20];
- is>> buff >> point.m_x;
- is >> buff >> point.m_y;
-
- return point;
- }
|