C binding with D function

lobo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 3 17:26:04 PDT 2016


On Wednesday, 3 August 2016 at 15:41:55 UTC, llaine wrote:

>   void foo(string str)
>   {
>     writeln(str);
>   }
>

shouldn't foo be:

void foo(char* str) {

     import std.string;
     writeln(str.fromStringz);

}


bye,
lobo


More information about the Digitalmars-d-learn mailing list