comp.lang.ada
 help / color / mirror / Atom feed
* Get a pointer to an array
@ 1999-06-05  0:00 Elad Rosenheim
  1999-06-06  0:00 ` David Botton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Elad Rosenheim @ 1999-06-05  0:00 UTC (permalink / raw)


This question may seem easy, but I haven't been able to find
a solution:

How do I create a normal array, then point an access type to it?
I tried to convert the array 'address attribute to the array access
type,
but it didn't work. I think ADA arrays have some "meta data" before
the data that contains the array bounds, and the 'address attribute
gives the address of the data storage itself. So how can I make the
access
variable point to the array?

This doesn't work:

    type int_array is array(integer <>) of integer;
    type int_access is access int_array;

    function To_Int_Access is new Unchecked_Conversion(
	system.address, int_access);
...

declare
    a : int_array(1..10);
    b : int_access;
begin
    a :=  To_Int_Access(a'address);
...

Please help me with this one.

Thanks,
Elad Rosenheim.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-06-09  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-05  0:00 Get a pointer to an array Elad Rosenheim
1999-06-06  0:00 ` David Botton
1999-06-06  0:00 ` Robert Dewar
1999-06-09  0:00 ` Steve Doiel

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