comp.lang.ada
 help / color / mirror / Atom feed
From: James Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: newbie q: access types getting address
Date: Wed, 13 Jun 2001 23:56:13 GMT
Date: 2001-06-13T23:56:13+00:00	[thread overview]
Message-ID: <3B27FE2D.F97EAD88@worldnet.att.net> (raw)
In-Reply-To: tifu13m7rmgr7b@corp.supernews.com

The address of an object can be identified as a System.Address type.

Read the Ada LRM section 13.7.2 for details.

What you probably really want to do is convert to or from the
System.Address type from an Ada access type. This can be done using
the System.Address_To_Access_Conversions generic package.
Once you convert from the C++ &Array[5] to an access to an Ada
array, you can access the individual elements using normal Ada
indexing.

Jim Rogers
Colorado Springs, Colorado USA

Jesse Farmer wrote:
> 
> Please pardon my ignorance, but I have not been able to find how to do this
> on the web.
> 
> I want to get the address of a particular object that is getting passed into
> a function.  How can I do this?
> Also, how can I get the address of some arbitrary element of an array?
> 
> Essentially, I want the return value of the following c++ statements:
> 
> return &Obj;
> and
> return &Array[5];
> 
> I understand that having pointers all over the place is somewhat discouraged
> in Ada, but this is for a Windows API call binding.  Sorry if this is
> obvious and I have overlooked it.  Any informative responses would be
> greatly appreciated.  Thanks for your time + bandwidth.
> 
> -Jesse Farmer
> University of Cincinnati



  reply	other threads:[~2001-06-13 23:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-13 23:24 newbie q: access types getting address Jesse Farmer
2001-06-13 23:56 ` James Rogers [this message]
2001-06-14  1:49 ` tmoran
2001-06-14 13:52 ` Jesse Farmer
replies disabled

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