Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!ut-sally!utah-cs!utah-gr!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.lang.c Subject: Re: double indirection Message-ID: <68@obie.UUCP> Date: 21 Feb 88 20:37:25 GMT References: <4292@rosevax.Rosemount.COM> Organization: UinTech, Layton, UT Lines: 19 Keywords: what use??? Summary: Double indirection in news sources! In article <4292@rosevax.Rosemount.COM>, richw@rosevax.Rosemount.COM (Rich Wagenknecht) writes: > Could someone give a small example of a use of double indirection or > just explain when and where it's used. Yah, look in the source for compress.c - it's part of the netnews sources. Compress uses a large array (~800K) to compress or un-compress files into. On stupid processors which don't support large arrays (such as the 286 I have), you have to map this into 64K arrays somehow. The way it is done in compress is actually create an array of pointers to arrays of 64K or less in size. You then calculate the location of whatever array entity you are trying to access by first deciding which of the arrays it is located in, and then deciding which element of that particular array you are trying to access. -- /\ - "Against Stupidity, - {backbones}! /\/\ . /\ - The Gods Themselves - utah-cs!utah-gr! / \/ \/\/ \ - Contend in Vain." - uplherc!sp7040! / U i n T e c h \ - Schiller - obie!wes