Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!stc!rmj From: rmj@tcom.stc.co.uk (The Phantom Countertenor) Newsgroups: comp.lang.c Subject: Re: Define a linked list of a linked list Message-ID: <2008@islay.tcom.stc.co.uk> Date: 20 Sep 90 12:12:38 GMT References: <13821@hydra.gatech.EDU> Reply-To: rmj@htc1.UUCP (The Phantom Countertenor) Organization: STC Telecomms, Harlow Technical Centre, Harlow Lines: 33 In article <13821@hydra.gatech.EDU> ce1zzes@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@islay.tcom.stc.co.uk * airlock breaks?" * rmj@tcom.stc.co.uk * --RETURN TO THE FORBIDDEN PLANET * rmj10@phx.cam.ac.uk * You've gotta be cruel to be Khund!