I'm busy with an assignment and have this below problem which I just cant seem to find a solution for.
The error i'm getting is "no matching function for call point".
Some notes:
1. my classes are all in 1 file. class "Point" is above class "Line".
2. the error indicates a problem on the constructor for "Line" class. Line (Point p1,Point p2) : Shape() . Then i thought maybe "Point" requires a default constructor. Once i add Point(); before the constructor in "Point" class - i get the error "Undefined reference to error" on line " Line (Point p1,Point p2) : Shape()"
3. If i change the system around and get rid of the constructor , then it works fine, but unfortunately i have to use constructors in this assignment.
Im not too sure if its the inheritance that im calling in Line class that's causing an issue.
Any help would be appreciated.
//############################################################
//############# Point ####################
//############################################################
class Point {
private:
int x;
int y;
public:
Point(int xx, int yy ){
x = xx;
y = yy;
}
int getY(){
return x;
}
QString toString();
int getX(){
return y;
}
};
//############################################################
//############# LINE ####################
//############################################################
class Line : public Shape{
private:
Point oneEnd;
Point otherEnd;
public: