I'm not sure what the post is asking, so I'll answer the title question.
Private members are only visible to other members. Protected members are visible to other members and derived classes, as well as friend classes. Public members are visible everywhere.
//I variant
class A1{ int X; };
class B1:public A1{ int X; };
class C1:public B1{ int X; };
//II variant
class A2{ int X; };
class B2:public A2{ };
class C2:public B2{ };
int main() {
std::cout << "Number of ints in C1=" << sizeof(C1) / sizeof(int) << std::endl;
std::cout << "Number of ints in C2=" << sizeof(C2) / sizeof(int) << std::endl;
}
Ok. Thanks. I think a prior to the Turbo Pascal is telling the truth with all its rigidity unlike
its descendands rapping around the field, including the C++.