how to convert to tchar[] to char[]..
A:
TCHAR is a Microsoft-specific typedef for either char or wchar_t (a wide character).
Conversion to char depends on which of these it actually is. If TCHAR is actually a char, then you can do a simple cast, but if it is truly a wchar_t, you'll need a routine to convert between character sets. See the function MultiByteToWideChar()
Nadir SOUALEM
2009-11-24 10:48:33
I think we need to convert from wchar_t to char so we need WidecharToMultiByte!!
Ahmed Said
2009-11-24 11:26:42
A:
it depends on the character set (unicode or ANSI) (wchar_t or char), so if your are using ansi simply TCHAR will be char without any casting, but for unicode you have to convert from wchar_t to char, you can use WideCharToMultiByte
Ahmed Said
2009-11-24 10:49:19