How do I convert a managed String type to a native char
type? If nothing is availbale, how do I copy the the
contents of the String object to a char array?
String* str = S"Hello world";
char c = (char)str->Chars[0];
--
Regards,
Nish [VC++ MVP]
"Kueishiong Tu" <ks****@seed.net.tw> wrote in message
news:0b****************************@phx.gbl...
How do I convert a managed String type to a native char type? If nothing is availbale, how do I copy the the contents of the String object to a char array?
String* str = S"Hello world"; char c = (char)str->Chars[0];
Well, that's one cast I'd stay away from, if you want your app to work when
"special" characters are in the string (remember that System::String is
UTF-16 encoded, while you are only handling 8-bit characters in char)