If at some point in my code, I assign 45 to i. Is there a way for my nested class to have access to i? As of now, whenever I create a function that needs both the nested class and the variable i, I am including both the base and nested class in the function. Is there a way I could include only the nested class and still have acces to i?
The author asked: "Is there a way for my nested class to have access to i?" where i is a non-static data member of the enclosing class. And you answered: "There is nothing special about a nested class."
It is incorrect statement. And I pointed out this.
Well, I guess you can argue that there is something special about nested classes. What I meant was that classes can't access non-static members of another class without having an instance of the other class. The same rules apply to nested classes so that was why I said there was nothing special about them.