2013年6月28日 星期五

Convert from char* to wchar_t*

To Convert char* to wchar_t*

Assume we have a char* string named c

    const size_t cSize = strlen(c)+1;
    wchar_t* wc = new wchar_t[cSize];
    mbstowcs (wc, c, cSize);


Now you have wchar_t* string wc.

You can also refer to http://twnin.blogspot.tw/2012/03/convert-between-char.html for more type to convert.