Visual studio is telling me I can't access a member variable from and instance of a parent class. Something like this:
class Point{
protected:
int x, y;
};
class Quadrilateral : public Point
{
protected:
Point A, B, C, D;
};
class Trapezoid : public Quadrilateral
{
public:
bool isTrapezoid() {
if (A.y == B.y && C.y == D.y)
return true;
return false;
}
};
It's say that Point::y
is not accessible through a pointer or object.
Can anyone tell me why?