Possible Duplicate:
How do you convert LPCWSTR to const char *?
I have a function that gets a LPCWSTR string for win32 api usage. Now I have a function that sends data in ASCII to the IRC server. So now I need to convert it to ASCII, I haven't found any solutions, I only found ways to convert ASCII to UNICODE.
WideCharToMultiByte converts from UNICODE to MBCS. If your original wide char string consisted only of characters which could be represented in ASCII, then this will result in a ASCII string. You can also use wcstombs which internally calls WideCharToMultiByte.
Either way, you will get a
LPSTR
orchar *
(which are the same).