auto example(char* test) { return toStringz(to!string(test) ~ " world!"); } When that return string will be freed? What about: extern(C) auto example(....) ?