im trying to input doubles into a lines p1 and p2. The code above tells me that x and y are private and that I cannot access it directly. I was asked to specifically use overloaded insertion operators to initialize the objects.
Hint: You can edit your post, highlight your code and press the <> formatting button. This will not automatically indent your code. That part is up to you.
You can use the preview button at the bottom to see how it looks.
I found the second link to be the most help.
That is because only a public member function can access a private member of the class. It looks like what you want is input>>setw(1)>>line.setp1(x); not input>>setw(1)>>line.p1.x;. I am not sure, but the "setw(1)" might be a problem.