www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/25/11:00:07

From: Cesar Rabak <csrabak AT uol DOT com DOT br>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Dynamically Allocated Arrays in C
Date: Wed, 25 Apr 2001 11:43:12 -0300
Lines: 18
Message-ID: <3AE6E280.6806376D@uol.com.br>
References: <iaxF6.15340$ff DOT 107947 AT news-server DOT bigpond DOT net DOT au> <9c6b8b$3dd$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: 200-221-14-196.dsl-sp.uol.com.br (200.221.14.196)
Mime-Version: 1.0
X-Trace: fu-berlin.de 988209951 12747048 200.221.14.196 (16 [39218])
X-Mailer: Mozilla 4.76 [en] (Win98; U)
X-Accept-Language: pt-BR,es,en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker wrote:
> 
[snipped]
> 
> As this is a generic C question, it's not a big surprise that the C
> FAQ (posted regularly to comp.lang.c, among other places) has the
> answer for it --- and it even manages to get away with only two
> malloc() calls, instead of (1+firstDim) ones.  Go figure.

Although you're quite right about the C-faq (question 6.16 covers this),
the technique along the lines of the OP (once cleared of the errors, it
is!) are proposed by a lot of sources, one of them the "Numerical
Recipes" book, as the access to the elements is more 'natural' and thus
the code more easy to read and by consequence more 'maintenable'.

HTH

Cesar

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019