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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d5f43eec59cdbb5 X-Google-Attributes: gid103376,public From: Niklas Holsti Subject: Re: Ada address of operator? Date: 1999/02/09 Message-ID: <36C0A636.C7ED48DA@icon.fi>#1/1 X-Deja-AN: 442549403 Content-Transfer-Encoding: 7bit References: <36C02FFC.458368B1@aston.ac.uk> Content-Type: text/plain; charset=us-ascii X-Trace: read1.inet.fi 918593671 194.252.1.155 (Tue, 09 Feb 1999 22:54:31 EET DST) Organization: Space Systems Finland Ltd MIME-Version: 1.0 NNTP-Posting-Date: Tue, 09 Feb 1999 22:54:31 EET DST Newsgroups: comp.lang.ada Date: 1999-02-09T00:00:00+00:00 List-Id: Danny wrote: (snipped; question on C operator "&" = "address of" in Ada) Use the 'Access attribute. Note the use of "all" in the declaration of the access types, and "aliased" in the declaration of the variable you are accessing. Example: package Ptrs is type AType is record X : integer; end record; type AnotherType is record Y : integer; end record; type ATypePtr is access all AType; type AnotherTypePtr is access all AnotherType; type AnotherTypePtrPtr is access all AnotherTypePtr; -- pAnotherType : aliased AnotherTypePtr; ppAnotherType : AnotherTypePtrPtr := pAnotherType'access; end Ptrs; But are you sure you need all those "Ptr"s? The standard Ada/C binding from pragma Import (C...) supplies some *'s automatically; see LRM B.3(63-84). - Niklas Working at but not speaking for Space Systems Finland Ltd