Were you just trying to BOLD that section and forgot the end? |
You guessed it! My apologies for the mistake - I've fixed it now.
So initializing the members separately will cause the compiler to reject this because Ellipse's constructor takes all of these parameters together at once so that is how it must literally see the arguments presented?? |
What you should understand is that you are not "initializing members" - you are simply invoking the constructor of
Ellipse. When you create an object of type
Arc you also creating an object of type
Ellipse, because an
Arc is an
Ellipse. So a constructor of
Ellipse will execute, as part of the process of creating an
Arc.
If you don't explicitly invoke a constructor of
Ellipse, then the default constructor will be invoked. But in your code,
Ellipse has no default constructor - hence the error you were originally getting.
When you wrote
Ellipse(p)
, what that actually means is that you were attempting to invoke a constructor that took a single argument of type
Point. Does such a constructor exist? I don't know - unless I've missed it, you haven't shown us that class. But it would be nonsense to try and invoke three different constructors for the same object.
From context, I'm assuming Ellipse does have a constructor that takes those three arguments, and so I wrote code that would invoke that constructor.
The point is, you have to specify a constructor that actually exists!