Re: Help needed for ada package



You could make Individual.Associate a packed array (1 .. 1_000_000) of
Boolean, set True if there's an Association .. though since
Association is symmetric as far as I can tell it might be better to
have a separate two-dimensional array for this.

I take it that ID is range 1 .. 1_000_000? if so you should index
Society by ID.

Why do you have pointers? you could just have an array of individuals.

Names are very important. "Pointer" is a very unhelpful name for the
concept you have in mind!

type Individuals is array (ID) of Indivuals;
Society : Individuals;

How are you going to know whether a given Individual exists? (has been
Rated, I think?)

--S
.



Relevant Pages

  • Re: Differance between Array and Pointers
    ... Well, except that arrays tend to be much larger than pointers, and the ... An array is a contiguous region of memory containing N elements of M ... indexing vs. a loop). ...
    (comp.arch.embedded)
  • [RFCv2][PATCH] flexible array implementation
    ... I call it a flexible array. ... storage for pointers to the second level. ... all locking must be provided by the caller. ... make sure to pass in &ptr instead of ptr. ...
    (Linux-Kernel)
  • [RFC][PATCH] flexible array implementation v4
    ... I call it a flexible array. ... so never does an order>0 allocation. ... storage for pointers to the second level. ... all locking must be provided by the caller. ...
    (Linux-Kernel)
  • Re: [RFC][PATCH] flexible array implementation v4
    ... I call it a flexible array. ... so never does an order>0 allocation. ... storage for pointers to the second level. ... all locking must be provided by the caller. ...
    (Linux-Kernel)
  • Re: [RFCv2][PATCH] flexible array implementation
    ... I call it a flexible array. ... storage for pointers to the second level. ... all locking must be provided by the caller. ... make sure to pass in &ptr instead of ptr. ...
    (Linux-Kernel)