Can we create nested classes in C?

A nested class may inherit from private members of its enclosing class. The following example demonstrates this: class A { private: class B { }; B *z; class C : private B { private: B y; // A::B y2; C *x; // A::C *x2; }; }; The nested class A::C inherits from A::B .

Sizin İçin Seçtik  1 Chainlink kaç dolar?

Leave a Reply

Your email address will not be published. Required fields are marked *