Convert String* to char*

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a managed C++ app in which i need to convert String * to char *.
How can i achive this?.


regards
-sarab
 
sarab said:
Hi,
I have a managed C++ app in which i need to convert String * to
char *. How can i achive this?.

See System.String.PtrToStringChars() to get a wchar_t __pin*. You can then
use wcstombs() or WideCharToMultiByte() to convert that wide-character
string to a narrow-character string.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top