I\'m studying a little of C++ and now I\'m fighting against it\'s similitudes with Java. I know the purpose of inner classes in Java, but now I\'m trying to use nested classes i
Different isn't the same.
Java's inner classes create objects that are assumed to be connected with an object of the outer class, so access to members of the outer class from methods of the inner class can be done without explicitly creating a pointer or reference. C++ doesn't do that; a nested class is just a class whose definition is nested inside the definition of another class. That's handy for encapsulation, but that's it: it's not intended to magically make objects of that type know about objects of the containing type.