classes

can we create a class within a class??
yes
Yes, we can.
Now I wonder how C++ compiler goes about initializing the class within. Are there any order needed?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Test {
  public:
  Test() {
  // inside here must instantiate and initialize Test1 and Test2 ? Or only when I need an object
  //of Test1 and Test2 then I initialize ?
  }

  private:
  class Test1 {

  };
  class Test2 {

  };
}
You can only initialize objects
Topic archived. No new replies allowed.