Lecture 5 - Slide 12 : 40
What about nested classes in C++?

Classes can be nested in C++

Similar to inner static classes in Java

No consequences for the nesting of instances of the involved classes

nested-1-f15-reorg.cpp
Class Outer that contains class Inner - does not compile.
nested-2-f14.cpp
Class Outer that contains class Inner - friends of each other.
Related examples below - study as an exercise
nested-2a.cpp
A variant where class Inner is private in Outer - does not compile.
nested-3.cpp
Inner attempts to access to non-static variable in Outer - does not compile.
nested-3a.cpp
Problems solved - This program compiles.
Go to exercise
Study the examples of nested classes