char* vs char[]
novice2
sorry at noem.ail
Mon Dec 18 02:00:29 PST 2006
== Quote from jicman (jicman at mail.com)'s article
> > are zero-terminated, you should use toStringz whenever passing D
> strings to
> > C functions.
> > return toString(getenv(toStringz(pSymbol)));
> thanks.
in non-english Windows, for my big sorrow,
imho, you need use
std.windows.charset.toMBSz() to pass char[] from D to C function,
and
std.windows.charset.fromMBSz() to pass char[] from C function to D,
in general case in _every char* in every call_ :(
how i bored with utf8 while program small windows console utilitis :
(
"invalid UTF8 sequence" on every time then i forget about fromMBSz()
it is very tiresome!
More information about the Digitalmars-d-learn
mailing list