gisle@spurv.ii.uib.no (Gisle S�lensminde) writes: > C has not 'in out' parameters, only 'in' parameters. To pass the > pointer to the string you can use system'address. str'address is > equivalent to &str in C. The following Ada code can replace > the Ada code of your last posting: Gisle, If you do this, you're missing a lot of typechecking. Certainly on GNAT the compiler has a deep understanding of "convention C" (this is covered in Annex B.3 (63) ff). I think the one you want is (68) -- a GNAT chars_ptr is (eventually) a System.Storage_Elements.Integer_Address -- but if your compiler doesn't handle this level of interfacing properly I think you should send it back for a refund! --------- strs.adb ----------------------------------------------------- with Interfaces.C.Strings; procedure Strs is procedure O_Str (O_Str : out Interfaces.C.Strings.Chars_Ptr); pragma Import (C, O_Str, "o_str"); procedure I_Str (I_Str : Interfaces.C.Strings.Chars_Ptr); pragma Import (C, I_Str, "i_str"); Str : Interfaces.C.Strings.Chars_Ptr; begin O_Str (Str); I_Str (Str); end Strs; ------------------------------------------------------------------------ --------- strs_c.c ----------------------------------------------------- #include #include char sig[] = "a message from o_str()"; void o_str(char **s) { *s = sig; } void i_str(char *s) { printf("i_str(%s).\n", s); } ------------------------------------------------------------------------ gcc -c strs_c.c gnatmake strs -largs strs_c.o -Simon