C++ examples for Data Type:struct
Allowing a struct to refer to itself
typedef struct SelfReferential { int i;/*from w w w .j a v a 2 s . co m*/ SelfReferential* sr; // Head spinning yet? } SelfReferential; int main() { SelfReferential sr1, sr2; sr1.sr = &sr2; sr2.sr = &sr1; sr1.i = 47; sr2.i = 1024; }