From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35a7a7cda284a484 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-13 16:56:13 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3B27FE2D.F97EAD88@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: newbie q: access types getting address References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 13 Jun 2001 23:56:13 GMT NNTP-Posting-Host: 12.86.32.85 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 992476573 12.86.32.85 (Wed, 13 Jun 2001 23:56:13 GMT) NNTP-Posting-Date: Wed, 13 Jun 2001 23:56:13 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:8704 Date: 2001-06-13T23:56:13+00:00 List-Id: 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