double indirection

Barnacle Wes wes at obie.UUCP
Mon Feb 22 06:37:25 AEST 1988


In article <4292 at rosevax.Rosemount.COM>, richw at 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



More information about the Comp.lang.c mailing list