From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71c743c03ed191fe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-18 18:25:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3D892773.3010402@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Beginer problem: variable array size References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 19 Sep 2002 01:25:28 GMT NNTP-Posting-Host: 63.184.1.31 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1032398728 63.184.1.31 (Wed, 18 Sep 2002 18:25:28 PDT) NNTP-Posting-Date: Wed, 18 Sep 2002 18:25:28 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:29144 Date: 2002-09-19T01:25:28+00:00 List-Id: Robert A Duff wrote: > "Nacho" writes: > > >>That does not resolve the problem. I need to change the size of the array >>after it has been created. With your solution once array_called_p has been >>created it will never change its size. > > > Right. You've been admonished about considering the "proper Ada" way of > allocating arrays local to a scope. You should consider those, but > those require that the array size be known at the point of creation. > There are many cases where you really need to change the size of an > existing array (despite the admonishments that this is rare -- I think > it's common). With all due respect to the person responsible for alligators in Ada, the C++ example showed 2 independent arrays, the sizes of which were known at the point of creation. For such an example, the use of local scopes to declare the arrays is probably safer and faster than messing around with pointers. Certainly there are times when an array needs to be resized, but this example isn't one of them. -- Jeff Carter "We burst our pimples at you." Monty Python & the Holy Grail