how can convert LPCSTR string into LPCTSTR string?

后端 未结 4 1463
迷失自我
迷失自我 2021-01-22 19:35

i am trying to convert a LPCSTR string into LPCTSTR string. i want to concatenate two string,when i try like this

LPCTSTR str1 = L\"Ra         


        
4条回答
  •  故里飘歌
    2021-01-22 20:05

    MultiByteToWideChar is the only way to go, if your code is compiled with UNICODE.

    Alternatively you can do this. 7bits ASCII -> wchar should be easy.

    TCHAR str3[256] = { 0 };
    for (int i = 0; str2[i] != 0; i++) str3[i] = str2[i];
    

提交回复
热议问题