Witam, od jakichś dwóch godzin próbuję napisać coś takiego:
class punkt
{
public:
int x,y;
public:
punkt(int x, int y)
{
this->x = x;
this->y = y;
}
};
class prosta
{
punkt a,b;
prosta(a,b)
{
this->a = a;
this->b = b;
}
void show()
{
cout << this->a.x+this->a.y+this->b.x+this->b.y << endl;
}
}
int main()
{
punkt a(1,1);
punkt b(3,2);
prosta x(a,b);
x.show();
}
};
ale oczywiście masa błędów. Podejrzewam, że coś z konstruktorem prostej, ale nie ogarniam tej złożonej konstrukcji :C