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.

Sizin İçin Seçtik  Içerisinde değerler tutan bölümlere ne isim verilir?

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

Sizin İçin Seçtik  How do you store a string in a structure?

Leave a Reply

Your email address will not be published. Required fields are marked *