From: Cesar Rabak 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: <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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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