Structure inside Structure
Hey guys
I'm having trouble adding and reading a structure inside a structure. I tried double arrows, but that doesn't work.
Code:
NOT REAL CODE:
Struct 1{
otherData ;
struct 2 ;
}
struct 2{
data;
}
To Add data: struct 2 I have struct1->struct2->data = something, but doesn't work.
To read data: struct1->struct2->data but that doesn't work.
(struct1->otherData works, but I guess it's because I haven't added the second struc data yet.. )
I've never worked with structs inside structs before so I dont really know. Oh yeah my code is just as an example, not actual code.
any input is highly appreciated.
!! EDIT
I have the pointer of struct 2 I want to add to struct 1.