If you have a member variable that is initialized by an instance of the same class, then when this instance is created, it will also have a member variable that is initialized by an instance of the same class, and when that instance it will also have a member variable. which is initialized by an instance of the same class, and when this instance is created, it will also have a member variable that is initialized by an instance of the same class, and when this instance it will also have a member variable, which is initialized an instance of the same class, and when this instance is created, it will also have a member variable that is initialized by an instance of the same class, and when this instance it will also have a member variable that is initialized by an instance of the same class, and when this an instance will be created, it will also have a member variable that is initialized by an instance of the same class, and when this instance is CRE ated, it will also have a member variable that is initialized by an instance of the same class, and when this instance If it is created, it will also have a member variable that is initialized by an instance of the same class, and when this instance it will also have a member variable that is initialized by an instance of the same class, and when this instance is created, it will also have a variable- a member that is initialized by an instance of the same class, and when this instance it will also have a member variable that is initialized by an instance of the same class, and when this instance is created, it will also have a member variable that and is initialized by an instance of the same class, and when this instance it will also have a member variable that is initialized by an instance of the same class, and when this instance is created, it will also have a member variable that is initialized by an instance of the same class ...
and then the stack overflows and it stops. This is normal if the object has a pointer to another instance of the same class as the member, but not so that you can create this instance in the constructor or initialize it in the class body, or you will recursively create objects until your stack overflows. Usually, if you want such a member variable, you take an object as an argument to the constructor.
source share