P
PhilB
Hello experts,
I am a complete beginner in C++ (although I know C).
I am trying to compile the code below, and I get
the following error.
Can anyone explain to me my mistake?
Thanks!
PhilB
myprog2.cpp: In method `Line::Line (Point, Point)':
myprog2.cpp:32: no matching function for call to `Point:oint ()'
myprog2.cpp:12: candidates are: Point:oint (int, int)
myprog2.cpp:9: Point:oint (const Point &)
myprog2.cpp:32: no matching function for call to `Point:oint ()'
myprog2.cpp:12: candidates are: Point:oint (int, int)
myprog2.cpp:9: Point:oint (const Point &)
myprog2.cpp:32: no matching function for call to `Point:oint ()'
myprog2.cpp:12: candidates are: Point:oint (int, int)
myprog2.cpp:9: Point:oint (const Point &)
//------------------------
class Point
{
protected:
int x;
int y;
public:
Point:oint(int, int);
};
Point:oint(int initx, int inity)
{
x=initx;
y=inity;
return;
}
class Lineublic Point
{
public:
Point start_point;
Point end_point;
public:
Line::Line(Point, Point);
};
Line::Line(Point initp1, Point initp2)
{
start_point=initp1;
end_point=initp2;
return;
}
main()
{
Point p1(10,20);
Point p2(20,40);
Line l1(p1,p2);
}
//------------------------
I am a complete beginner in C++ (although I know C).
I am trying to compile the code below, and I get
the following error.
Can anyone explain to me my mistake?
Thanks!
PhilB
myprog2.cpp: In method `Line::Line (Point, Point)':
myprog2.cpp:32: no matching function for call to `Point:oint ()'
myprog2.cpp:12: candidates are: Point:oint (int, int)
myprog2.cpp:9: Point:oint (const Point &)
myprog2.cpp:32: no matching function for call to `Point:oint ()'
myprog2.cpp:12: candidates are: Point:oint (int, int)
myprog2.cpp:9: Point:oint (const Point &)
myprog2.cpp:32: no matching function for call to `Point:oint ()'
myprog2.cpp:12: candidates are: Point:oint (int, int)
myprog2.cpp:9: Point:oint (const Point &)
//------------------------
class Point
{
protected:
int x;
int y;
public:
Point:oint(int, int);
};
Point:oint(int initx, int inity)
{
x=initx;
y=inity;
return;
}
class Lineublic Point
{
public:
Point start_point;
Point end_point;
public:
Line::Line(Point, Point);
};
Line::Line(Point initp1, Point initp2)
{
start_point=initp1;
end_point=initp2;
return;
}
main()
{
Point p1(10,20);
Point p2(20,40);
Line l1(p1,p2);
}
//------------------------