Create Line class (which has nothing to do with printing):
Code:
namespace MyProgram {
class Line
{
public:
Line(const Point& a, const Point& b):
mA(a),
mB(b)
{
}
const Point& GetA() const
{
return mA;
}
const Point& GetB() const
{
return mB;
}
void SetA(const Point& a)
{
mA = a;
}
void SetB(const Point& b)
{
mB = b;
}
private:
Point mA;
Point mB;
};
}
And then call the Line() function from graphics.h. You didn't provide the signature of Line(), so nobody can tell how to call it properly. It will be more or less like this:
Code:
Line line(Point(100, 150), Point(200, 250)); // construct line by calling its constructor; pass two points
...
::Line(line.GetA().GetX(), line.GetA().GetY(), line.GetB().GetX(), line.GetB().GetY()); // call Line() from graphics.h, passing coordinates of two line's points