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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c8360a2ce0e343cc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: address/access/pointer confusion Date: Wed, 20 Oct 2004 18:55:56 +0200 Organization: AdaCL Message-ID: <4867610.6NcCWSqDf3@linux1.krischik.com> References: <1c2f5137.0410200556.70a1518c@posting.google.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1098292978 01 25559 iOFIXdyrB7+fV8e 041020 17:22:58 X-Complaints-To: usenet-abuse@t-online.de X-ID: SX5Bd-ZSZedLW9YQFFptmyEG49zOnPTILr7tXoGeL3dg8m8FWPR+QI User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:5537 Date: 2004-10-20T18:55:56+02:00 List-Id: Hans Van den Eynden wrote: > On > http://groups.google.com/groups?hl=nl&lr=&threadm=wvbr657egsa1.fsf%40sun.com&prev=/groups%3Fnum%3D25%26hl%3Dnl%26lr%3D%26group%3Dcomp.lang.ada%26start%3D300 > I read > >> First, is it correct to say that Ada access types are more >> similar to C++ references (T&) than they are to C/C++ >> pointers (T*) ? > > No. Ada access types are very similar to C and C++ pointers, and are > typically implemented and used in (almost) exactly the same way. > > On > http://groups.google.com/groups?hl=nl&lr=&threadm=ss%25ad.1636%246k2.1252%40newsread3.news.pas.earthlink.net&prev=/groups%3Fhl%3Dnl%26lr%3D%26group%3Dcomp.lang.ada > I read > > Well an access is not a pointer. System.Address is a pointer. There > are > functions to convert an access to an Address..An access may contain > additional informations apart from the pointer - like size of the > object > pointed to (for indefinite objects), a reference counter (for access > all or > anonymous access) etc. pp. > > I think that not the same definition?? > Can anybody tell me the exact difference between pointer in C++ and > access/address types in Ada??? Well an Address is closest to an void*. As it is an address of some object in memory. An Access could be several things. Depending on you compiler vendor it could be normal pointer, or a smart pointer or a handle. The representation of an access can also be influenced. For example you can use pragma Convention (C, ...) to make an access C compatible. Or you can use For A'Storrage_Pool use ... to handle you own memory. Or you use "access all" to have an access which can point to non heap memory. In an Acceess is more then just a pointer or reference. With Regards. -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com