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.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_DATE,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ff016264a967a8e0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-19 01:21:11 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news.sprintlink.net!pipex!uunet!newstf01.news.aol.com!not-for-mail From: whitteng@aol.com (Whitteng) Newsgroups: comp.lang.ada Subject: Re: Access type conversion... Date: 19 Jan 1995 04:21:11 -0500 Organization: America Online, Inc. (1-800-827-6364) Sender: root@newsbf02.news.aol.com Message-ID: <3flau7$bgu@newsbf02.news.aol.com> References: Reply-To: whitteng@aol.com (Whitteng) Date: 1995-01-19T04:21:11-05:00 List-Id: Fisrt of all I have to ask, "Are you thinking like a C programmer?". Shame, shame! A System.Address does not have to be the same thing as an access type. On some compilers they are not even the same size (e.g. System.Address is 4-bytes while access types are only 2-bytes). In all of the work we do we require System.Address and access types to be the same size. The others have shown examples of how to get the string's address. Our standard way of getting the address of the first element of an array is addr := array(array'first)'address; This works and seems to be the most portable. Something like addr := array'address, does not have to give you the address of the array's first element, it has to give you the address of the first storage allocation unit the array uses. This may be a hidden data area that contains info about the array (e.g. first, last). There is really not much you can do with the address to the array in Ada, but we find it quite usefull when interfacing with a library that may have been written in assembler or C. TTFN < ; - | )