From: nospam DOT cbrooker AT iafrica DOT com (Marc Brooker) Newsgroups: comp.os.msdos.djgpp Subject: Freeing memory from a tree Date: Tue, 27 Apr 1999 15:30:34 GMT Organization: UUNET Internet Africa Lines: 25 Message-ID: <37255021.5017576@news.iafrica.com> NNTP-Posting-Host: 196-31-20-197.iafrica.com X-Trace: nnrp01.iafrica.com 925227145 84309 196.31.20.197 (27 Apr 1999 15:32:25 GMT) X-Complaints-To: abuse AT iafrica DOT com NNTP-Posting-Date: 27 Apr 1999 15:32:25 GMT X-Newsreader: Forte Free Agent 1.11/32.235 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I am busy writing a program similar to the one that Richard Dawkins uses in 'The Blind Watchmaker', basically to draw trees based on a set of genes. For this I use a 'linked tree', each bud, a structure has pointers to two more, it's childeren. Starting with one bud, this develops a tree, the buds store other information such as angle and length. How would I go about freeing the memory I allocated, all the methods I use miss some of the buds, in the end I created an array storing pointers to all the buds on the tree and free them in turn. I am very sure that this is not the most efficient way to do this. Amongst other things, I am storing two copies of everything in memory. What is a better way? Browsing on the GNU site I noticed that they had a program like this on their page of projects for people to do, I e-mailed the gnu guy and he told be that he wasn't interested unless I ported it to linux. My program uses the Allegro library. How would I go about proting the graphics routines? I have lots of documentation on porting unix programs to dos but not vice versa. Please will someone show me the light! Thanks in advance for any help. Marc.