converting c's c* to d strings

Xinok xnknet at gmail.com
Sat Jun 28 14:18:17 PDT 2008


llee wrote:
> Does anyone know how to convert from character array pointers in c to d strings using Phobos? 

You can convert any pointer type to an array type using slicing.

import std.c.string;
char* cstr;
string dstr = cstr[0..strlen(cstr)];



More information about the Digitalmars-d mailing list