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-Thread: 103376,5198a899ac00c6e1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bos-service1.raytheon.com!dfw-service2.ext.ray.com.POSTED!53ab2750!not-for-mail From: Jeffrey Carter User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: pointer References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 31 Aug 2005 11:52:19 -0700 NNTP-Posting-Host: 147.24.111.90 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.ray.com 1125514340 147.24.111.90 (Wed, 31 Aug 2005 13:52:20 CDT) NNTP-Posting-Date: Wed, 31 Aug 2005 13:52:20 CDT Organization: Raytheon Company Xref: g2news1.google.com comp.lang.ada:4349 Date: 2005-08-31T11:52:19-07:00 List-Id: TC wrote: > How translate this c code? It depends on what you mean by "translate". One could write C-in-Ada that would be just like this, with all the opportunities for error that implies. However, it looks as if you're implementing a linked list with a record as its data. To do that it's probably best to use the list component of the standard data-structure library that will be part of Ada 0X. If you can't do that, because you don't have an Ada-0X compiler, you can find list components in most of the many fine Ada data-structure libraries that are available on the web. I recommend the PragmAda Reusable Components, but I may be biased. Looking more closely, this appears to be part of a word-counting program, and so probably homework. If you're doing word counting, you probably want something that allows O(log N) (or better) insertions and lookup, such as a map component from Ada.Containers (Ada 0X), or the skip list from the PragmARCs. -- Jeffrey Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Grail E-mail: jeffrey_r_carter-nr [commercial-at] raytheon [period | full stop] com