comp.lang.ada
 help / color / mirror / Atom feed
From: kst@alsys.com (Keith Thompson)
Subject: Re: Access type conversion...
Date: Fri, 20 Jan 1995 08:59:31 GMT
Date: 1995-01-20T08:59:31+00:00	[thread overview]
Message-ID: <D2p4z8.Hyn@thomsoft.com> (raw)
In-Reply-To: 3flau7$bgu@newsbf02.news.aol.com

In <3flau7$bgu@newsbf02.news.aol.com> whitteng@aol.com (Whitteng) writes:
> 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.

Don't forget that this will raise Constraint_Error if the array has a
length of 0.

In the most common case, interfacing to C, this probably won't be a
problem; most C functions that take strings require at least a NUL
character.

-- 
Keith Thompson (The_Other_Keith)  kst@thomsoft.com (kst@alsys.com still works)
TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
When you're a nail, every problem looks like a hammer.



  reply	other threads:[~1995-01-20  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mbejeranD2Hn5E.q5@netcom.com>
1995-01-18 18:51 ` Access type conversion R. William Beckwith
1995-01-19  9:21 ` Whitteng
1995-01-20  8:59   ` Keith Thompson [this message]
1995-01-20  0:12 ` Garlington KE
replies disabled

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