comp.lang.ada
 help / color / mirror / Atom feed
From: Rob Solomon <usenet@drrob1-noreply.com>
Subject: Re: Table of pointers question
Date: Sat, 26 Sep 2009 09:50:05 -0400
Date: 2009-09-26T09:50:05-04:00	[thread overview]
Message-ID: <tp6sb558m7t8ta85pbheedlrd5l56cn23b@4ax.com> (raw)
In-Reply-To: u1vlwesl7.fsf@stephe-leake.org

>Rob Solomon <usenet@drrob1-noreply.com> writes:
>
>>   EntryList        : array (1..MaxEntries) of DirectoryEntryType;
>>   EntryPointerList : array (1..MaxEntries) of DirectoryEntryPointerType;
>
>> My question is that I would expect to have an array that contains the
>> data, 
>
>That might appear to be EntryList. Except that EntryList is never used
>in the code you quoted. I don't have the book handy, so I don't know
>if it is used elsewhere.
>
>> and a second array that is an array of pointers to the 1st array.
>
>That's EntryPointerList. However, the pointers simply point to
>allocated memory, not to elements of EntryList or any other data
>structure. 
>
>Why did you expect pointers into an array?
>
>> The example does not define that.
>>
>> How does the line:
>> EntryPointerList(NumberOfEntries) := new DirectoryEntryType'(NewEntry)
>> ;
>>
>> Do what's needed?
>
>This allocates memory for the data contained in NewEntry, and stores a
>pointer to it in EntryPointerList.
>
>The rest of the code then moves these pointers around in
>EntryPointerList.
>
>What other languages are you familiar with? Perhaps we could relate
>this Ada code to one of them.

I am very familiar with Wirth languages.  I have been using Modula-2
since the 80's.  

Some of my confusion can be due to the fact that I am merely a
recreational programmer that programs for his own use and amusement.



  reply	other threads:[~2009-09-26 13:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24  0:47 Table of pointers question Rob Solomon
2009-09-24  1:34 ` Adam Beneschan
2009-09-24  6:39   ` tmoran
2009-09-25 16:52   ` björn lundin
2009-09-25 17:12     ` Adam Beneschan
2009-09-24  2:00 ` (see below)
2009-09-24  3:46 ` Jeffrey R. Carter
2009-09-24  6:59 ` Georg Bauhaus
2009-09-24  7:06   ` Georg Bauhaus
2009-09-24 14:55   ` Adam Beneschan
2009-09-26 13:45     ` Rob Solomon
2009-09-24  6:59 ` Stephen Leake
2009-09-26 13:50   ` Rob Solomon [this message]
     [not found] ` <3cadnZif2YjGbyfXnZ2dnUVZ_tmdnZ2d@earthlink.com>
2009-09-24 12:49   ` Robert A Duff
2009-09-26 13:36   ` Rob Solomon
2009-09-26 14:51     ` John B. Matthews
     [not found]     ` <3YSdnY7SXPNd_yPXnZ2dnUVZ_sydnZ2d@earthlink.com>
2009-09-26 18:58       ` Rob Solomon
2009-09-26 21:00       ` Georg Bauhaus
2009-09-27  5:53     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox