So lets say that I have a class named A. Class A has several basic properties, however one of it's properties is supposed to be of type Class A. Here is an example of what I am talking about:
class A {
public:
int a;
bool b;
A c;
};
However, when I try to build this, I get the error "incomplete type is not allowed", which I am assuming has to do with the fact that property c does not have a definition for A yet, but even if I put:
class A;
before I construct class A, however I still get the error "incomplete type is not allowed". If anyone knows how to create a property of type class A inside of class A, I would appreciate your help. Thanks
Edit: I do not believe this post is a duplicate because I am trying to find out How you can create a property of type class A inside class A, instead of simply "why you can't create an instance of itself..."