comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to convert a C "char *" value to Ada string?
Date: Mon, 21 Jul 2014 19:28:59 -0500
Date: 2014-07-21T19:28:59-05:00	[thread overview]
Message-ID: <lqkb8b$6a6$1@loke.gir.dk> (raw)
In-Reply-To: lqk8lm$hss$1@speranza.aioe.org

"Victor Porton" <porton@narod.ru> wrote in message 
news:lqk8lm$hss$1@speranza.aioe.org...
> How to convert a C "char *" value to Ada string?
>
> There is
>
>   function To_Ada (Item     : in char_array;
>                    Trim_Nul : in Boolean := True)
>      return String;
>
> in package Interfaces.C, but it receives an array not a pointer (= 
> access).
>
> So I don't understand how to do this simple thing.

You didn't look far enough in the RM. Look at Interfaces.C.Strings and/or 
Interfaces.C.Pointers (B.3.1 and B.3.2, respectively). You probably want 
Interfaces.C.Strings.

                     Randy. 


      parent reply	other threads:[~2014-07-22  0:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 23:44 How to convert a C "char *" value to Ada string? Victor Porton
2014-07-22  0:19 ` Victor Porton
2014-07-22  0:28 ` Randy Brukardt [this message]
replies disabled

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