comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Interfaces.C.Pointers
Date: Sun, 22 Jun 2003 03:28:42 GMT
Date: 2003-06-22T03:28:42+00:00	[thread overview]
Message-ID: <Kn9Ja.746814$Si4.881642@rwcrnsc51.ops.asp.att.net> (raw)

I seems to me that Interfaces.C.Pointers really isn't just about C
pointers (though that may be its main use), but the Value functions
let you convert a pointer to an element to a pointer to an array
of variable size.
  type general_array_type is array(integer range <>) of integer;
  procedure p(pi : access integer; length : natural) is

  type static is array(1 .. 3) of integer;
  x : static;
  p(x(x'first),3);
Inside procedure p, by using Interfaces.C.Pointers, you can
  my_copy : general_array_type := value(pi, ptrdiff_t(length));
Am I misunderstanding?



                 reply	other threads:[~2003-06-22  3:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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