Hey folks, I have a constructor for class Line2D that takes in 2 Point2D objects as arguments. My intention is to create 2 separate Point2D objects, before creating a Line2D object and pass in the Point2D objects to the constructor upon creation. However when I try to compile the code, it gives me an error because it apparently attempts to call a default constructor for Point2D that doesn't exist. I don't understand why it does this as Line2D is not a child class of Point2D; I understand how inheritance and constructors work but the relationship here is composition rather than generalization. How would I solve this problem? My code is below. Thanks for the help.
Point2D::Point2D(int ecks, int why)
x = ecks;
y = why;
Point2D pt1, pt2;