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,9d66743a9fdd96bd X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: question about functions Date: 2000/01/20 Message-ID: #1/1 X-Deja-AN: 575381962 References: <867e3p$8ph$1@news.mgn.net> X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov X-Trace: skates.gsfc.nasa.gov 948395417 2177 128.183.220.71 (20 Jan 2000 19:10:17 GMT) Organization: NASA Goddard Space Flight Center NNTP-Posting-Date: 20 Jan 2000 19:10:17 GMT Newsgroups: comp.lang.ada Date: 2000-01-20T19:10:17+00:00 List-Id: "Pascal LEJEUNE" writes: > I explain : > if C := f(A, B); > > how can i know, in f, C's addres ? > function f(A, B : in T) return T is > ... > begin > ... > address of the result of f ? > ... > end f; You can't find the address of C from within f, in Ada, C, or any other moderatly high level language. Only assembler lets you do that, as far as I know. If you could, what would you do with it? Maybe there is another way to get the same effect. One alternate approach that is possible in Ada is to pass the result as an 'out' parameter : procedure f (A, B : in T; C : out T); now you can do C'Address. I'd still like to know what you are going to do with it. -- Stephe