comp.lang.ada
 help / color / mirror / Atom feed
* Single statment STRING to chars_ptr... how to?
@ 2000-03-14  0:00 Al Johnston
  2000-03-15  0:00 ` Ted Dennison
  0 siblings, 1 reply; 3+ messages in thread
From: Al Johnston @ 2000-03-14  0:00 UTC (permalink / raw)


I am playing around with moving data between ada's "String" and
interfaces.c.strings's "chars_ptr".

Is it possible to do this operation as a single statement and without
allocating memory (i.e. no calls to things like new_string, new, etc)..
I thought

  my_chars_ptr  := interfaces.c.strings.to_chars_ptr(
                      interfaces.c.to_c(my_string)'access);

would work... but it will not compile.

I know how to accomplishes this using multi-statments along with
a call to i.c.s.new_string and i.c.s.free;  that solution is not
what I am looking for.

anyone know how to do this?

thanks,





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-03-15  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-14  0:00 Single statment STRING to chars_ptr... how to? Al Johnston
2000-03-15  0:00 ` Ted Dennison
2000-03-15  0:00   ` Al Johnston

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