Passing string from D to c++
John Colvin
john.loughran.colvin at gmail.com
Tue Jul 30 13:17:32 PDT 2013
On Tuesday, 30 July 2013 at 20:09:01 UTC, Milvakili wrote:
> On Tuesday, 30 July 2013 at 20:02:51 UTC, Dicebot wrote:
>> On Tuesday, 30 July 2013 at 19:52:44 UTC, Milvakili wrote:
>>> I'm linking D with C++ lib.a file. When the C++ function has
>>> compatible data types I can call them from D. But when I
>>> changed the parameter to string I got bunch of errors.
>>>
>>> Data Type Compatibility table does not include strings. Is
>>> there a way of passing strings?
>>
>> http://dlang.org/phobos/std_string.html#.toStringz
>
>
> So I need to pass them as char*, I can not pass them as string?
Correct.
Just thinking off the top of my head: you could probably hack
something together though with a struct and casting.
More information about the Digitalmars-d
mailing list