私はこのコードスニペットを持っています
#include <iostream>
using namespace std;
class Polygon
{
public:
int publicmemberPolygon;
private:
int privatememberPolygon;
protected:
int protectedmemberPolygon;
};
class Square : public Polygon
{
public:
int Getter();
};
int Square::Getter()
{
return privatememberPolygon;
}
int main()
{
}
問題は、なぜprivatememberPolygonにアクセスできないのですか? 派生クラスがある場合、そのメンバー/関数はすべてコピーされますか? ありがとう