Windows/MFC

CString 상에서 연속적으로 들어오는 유니코드형식에 CString을 Unicode로 변환

aucd29 2013. 10. 2. 18:06
[code]// toUnicode.cpp : Defines the entry point for the console application.
//

// 말이 좀 복잡하다 -_-ㅋ

#include "stdafx.h"
#include <Windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
    wchar_t* szData = L"004d";
    long N;
    wchar_t data[20];

    wsprintf(data, L"0x%s", szData);
    swscanf(data, L"%x", &N);
    wprintf_s(L"%c", N); // M 이찍힌다.

    return 0;
}

[/code]