Define a linked list of a linked list
The Phantom Countertenor
rmj at tcom.stc.co.uk
Thu Sep 20 22:12:38 AEST 1990
In article <13821 at hydra.gatech.EDU> ce1zzes at prism.gatech.EDU (Eric Sheppard) writes:
}The problem: I'm not quite sure how to handle a linked list of a linked list.
}Structure : First member 4 char header, successive members 6 char data and
} 1 char flag.
}
}struct inner {
} char data[7];
} char flag;
} struct inner *next;
} };
}typedef struct inner INNR;
}typedef INNR *PT_INNR;
}
}struct outer {
} char header[5];
} struct INNR; <- not sure about this declaration. Use pointer?
} struct outer *next;
} };
}typedef struct outer OUTR;
}typedef OUTR *PT_OUTR;
}
}Are there any dangers involved with this setup? Advice would be appreciated...
This looks fine to me. I would be inclined to use a pointer in the
struct outer declaration, but the only pressing reason for doing so is
if you think you may get a situation of having a header with no data
attached (using a NULL pointer as meaning no more data hanging off here,
as usual.
--
* Windsinger * "But soft, what light through yonder
* rmj at islay.tcom.stc.co.uk * airlock breaks?"
* rmj at tcom.stc.co.uk * --RETURN TO THE FORBIDDEN PLANET
* rmj10 at phx.cam.ac.uk * You've gotta be cruel to be Khund!
More information about the Comp.lang.c
mailing list