Can inner class access outer class variables C++?

An inner class is a friend of the class it is defined within. So, yes; an object of type Outer::Inner can access the member variable var of an object of type Outer .

Sizin İçin Seçtik  Borsada Tahtacılar kimdir?

Leave a Reply

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