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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9eef6c480abeecf8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!xmission!news.utah.edu!newsfeed.cs.utexas.edu!geraldo.cc.utexas.edu!not-for-mail From: bdbryant@mail.utexas.edu (Bobby D. Bryant) Newsgroups: comp.lang.ada Subject: Re: Dynamic array allocation and STL equivalents? Date: Fri, 11 Feb 2005 17:24:00 +0000 (UTC) Organization: dis- Message-ID: References: <1108127216.221977.60830@o13g2000cwo.googlegroups.com> Reply-To: bdbryant@mail.utexas.edu NNTP-Posting-Host: dial-a-128-83-57-19.telesys.its.utexas.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: geraldo.cc.utexas.edu 1108142640 10590 128.83.57.19 (11 Feb 2005 17:24:00 GMT) X-Complaints-To: abuse@utexas.edu NNTP-Posting-Date: Fri, 11 Feb 2005 17:24:00 +0000 (UTC) X-Newsreader: knews 1.0b.1 Xref: g2news1.google.com comp.lang.ada:8249 Date: 2005-02-11T17:24:00+00:00 List-Id: On Fri, 11 Feb 2005, brian.b.mcguinness@lmco.com wrote: > Back in the mid 1980s, out of curiosity I bought books about a number > of programming languages, including LISP and Forth. One of these books > was a turquoise and white paperback about Ada by J.G.P. Barnes. During > a summer vacation trip, I read the Barnes book while riding for hours > down highways in the car. I was impressed with features such as being > able to overload operators for newly defined types, the exception > handling facilities, and the ability to write constants in a wide > variety of bases. My impression was that this was Pascal done right. Pascal pretty much _was_ "done right", given its pedagogical purpose. > But at the time I didn't have access to an Ada compiler, so I couldn't > play with the language. > > Recently, while looking through a list of GNU software, I was reminded > that there is a Gnu Ada compiler, so I installed it on a computer at > home, along with its library. So far I have not found an rpm package > of GtkAda for Fedora Core 3, but I am still looking. Google for 'gnat "fedora core 3"' and you'll get some hits which may have what you want. (Use your own judgement as to how safe a given download site is.) > I would like to write a few Ada programs and play around with the > language a bit. From the mid 1980s through the early 1990s I wrote > programs in Borland Turbo Pascal 3 through 6, which I was quite fond > of, so I shouldn't have much trouble picking up Ada, which has a > similar syntax. But there are a few things I don't know how to do. > For one thing, I have looked through the Barnes book, the pages of > which have turned tan with age, and online, but can't find any > information on how to allocate arrays dynamically; there seems to be no > equivalent to the C malloc() function or the C++ dimensioned new. If > someone would tell me how to do this, I would appreciate it. Others have already answered this, but I'd like to add that your book is apparently pre- Ada95, so you may want to get a newer book, or at least consult some on-line sources to see what has changed. Here's the Ada95 reference manual: http://www.adahome.com/rm95/rm9x-toc.html, though it is probably easier to learn from a book. Here's a page about Ada83 vs. Ada95: http://www.adaic.org/learn/tech/8395comp.html -- Bobby Bryant Austin, Texas