SPRING :: NOTE

[C] TCHAR <-> char 형변환 본문

Development Language/C · C++ · MFC

[C] TCHAR <-> char 형변환

RAYZIE 2016. 6. 28. 17:55
반응형

TCHAR -> char

TCHAR temp[256]=L"Sample Text";
int strLen = 256;
char cTemp[256];
 
WideCharToMultiByte(CP_ACP, 0, temp, strLen, cTemp, strLen, NULL, NULL);
printf("%s" , cTemp);

char -> TCHAR

char buff[]="Sample Text";
TCHAR szUniCode[256]={0,};
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, charBuff, strlen(buff), szUniCode, 256);


반응형
Comments