comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve Doiel" <nospam_steved94@attbi.com>
Subject: Re: Question of data type
Date: Thu, 14 Mar 2002 02:43:40 GMT
Date: 2002-03-14T02:43:40+00:00	[thread overview]
Message-ID: <w7Uj8.34027$af7.26607@rwcrnsc53> (raw)
In-Reply-To: 3c8ff5df$1_7@news3.uncensored-news.com

"Bigg K" <bigg_k@mailandnews.com> wrote in message
news:3c8ff5df$1_7@news3.uncensored-news.com...
> I'm using Rational Apex 3.2.0b.  (I don't have a choice in the matter.)
>
> My question:
>
> X is a record.  If I want to assign X'Address to Y, what data type
(integer,
> float, etc) does Y have to be?
>

On the odd chance that you're coming to Ada from the C world, there are (at
least) two possible answers for this question.

The first answer:

  You say that X is a record,  assume that record is of type T.

If you want to have a data type that permits you to reference records of
type T, you can define a new type:

  type TA is access all T;

And then declare an access variable (similar to a typed pointer in C)

  taccess : TA;

In order to permit the value in X to be referenced by an access type you
must declare X as aliased:

  X : aliased T;

Then you can do the assignment

  taccess := X'ACCESS;

The second answer:
If you want to get the equivalent to C's void pointer, the type of the
pointer would be System.Address.  That is

  P : System.Address;

  P := X'Address;

I hope this helps,

SteveD

> Thanks for your help...
>
> ______________________________________________________________________
> Posted Via Uncensored-News.Com - Still Only $9.95 -
http://www.uncensored-news.com
>    With NINE Servers In California And Texas - The Worlds Uncensored News
Source
>





  parent reply	other threads:[~2002-03-14  2:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-14  0:59 Question of data type Bigg K
2002-03-14  1:13 ` sk
2002-03-14 20:14   ` Marin David Condic
2002-03-14  1:26 ` tmoran
2002-03-14  2:43 ` Steve Doiel [this message]
2002-03-14  6:31 ` Jeffrey Carter
2002-03-14 20:17   ` Marin David Condic
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox