Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!uunet!zephyr.ens.tek.com!uw-beaver!cornell!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!rg2c+ From: rg2c+@andrew.cmu.edu (Robert Nelson Gasch) Newsgroups: comp.sys.mac.programmer Subject: Re: Linked Lists: Handles or Pointers? Message-ID: Date: 24 Jan 91 05:35:34 GMT References: <1991Jan23.002212.7648@umiami.ir.miami.edu> Organization: Class of '91, Carnegie Mellon, Pittsburgh, PA Lines: 27 In-Reply-To: <1991Jan23.002212.7648@umiami.ir.miami.edu> On 23-Jan-91 in Linked Lists: Handles or Po.. user Mondo@umiami.ir.miami.ed writes: >Okay folks, here's yer big chance to solve a silly little argument for >three of us novice Mac programmers. > >If you want to create a linked list, do you have to: > > a) Use a handle to the head node only and use pointers > for the rest of the list (Problem we see: the Memory > Manager will compact the heap and make all those ptrs invalid.) > > or > > b) Use linked handles for every node in the list. > >Please help us. Thanks. I'm no expert on the subject, but here's my response: I'm not sure what the problem is. I Started programming in C a year ago and translated my linked list routines from Pascal without any problems. They use pointers only, no handles. If there's an issue of Mac programming I'm missing, please alert me, but I don't see any reason why a linked list should have to use handles. Even the head you can just malloc() and free(), so I see nothing that would require the use of handles. --Rob