Declare an object even before that class is created

前端 未结 5 625
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 14:03

Is there anyway to declare an object of a class before the class is created in C++? I ask because I am trying to use two classes, the first needs to have an instance of the sec

5条回答
  •  离开以前
    2021-02-04 14:35

    Is this close to what you want: The first class contains the second class, but the second class (that is to be created first) just has a reference to the first class?

提交回复
热议问题