SimpleCxxLib packageclass Pointgtypes.h
interface instead.
| Constructor | |
Point(x, y) | Creates a Point object with the specified x and y coordinates. |
| Methods | |
| Returns the x-coordinate of the point. | |
| Returns the y-coordinate of the point. | |
Returns a string representation of the Point in the form "(x, y)". | |
| Operator | |
Overloads the << operator so that it is able to display Point values. | |
Point(); Point(int x, int y);
Point object with the specified x and y coordinates.
If the coordinates are not supplied, the default constructor sets these
fields to 0.
Usage:
Point origin; Point pt(x, y);
int getX() const;
Usage:
int x = pt.getX();
int getY() const;
Usage:
int y = pt.getY();
string toString() const;
Point in the form
"(x, y)".
Usage:
string str = pt.toString();
ostream & operator<<(ostream & os, const Point & pt);
<< operator so that it is able
to display Point values.
Usage:
cout << pt;