struct A { int data; B b; }; To do that, the compiler needs to already know what B is, so declare that struct before you declare A . Well, you can say struct B , but again, that’s just the type. You still need give it a name.
How do you use a struct inside a struct?
struct A { int data; B b; }; To do that, the compiler needs to already know what B is, so declare that struct before you declare A . Well, you can say struct B , but again, that’s just the type. You still need give it a name.