views:

851

answers:

2

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
I think we need to convert from wchar_t to char so we need WidecharToMultiByte!!
Ahmed Said
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