This is my first cpp program, so please be patient with me...
I am trying to practice applying constructors on a composed class, and have learned that in case of a composed class, the outer class ctor is responsible for initialaizing the inner class, and this can be achieved by using an initialization list.
So here's my code:
Rectangle(int px, int py, int width, int height);
and heres my ctor :
Rectangle::Rectangle(int px,int py,int width,int height)
Still, I get a compiler error C2664: '__thiscall Point::Point(const class Point &)' : cannot convert parameter 1 from 'int' to 'const class Point &'
Reason: cannot convert from 'int' to 'const class Point'
No constructor could take the source type, or constructor overload resolution was ambiguous
I understand the meaning of this error, but isnt this what init. list are for?