how can convert LPCSTR string into LPCTSTR string?

后端 未结 4 1459
迷失自我
迷失自我 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:19

    I tried this it worked:

    #include 
    #include 
    
    using namespace std;
    int main()
    {
        LPCSTR stringToConvert = "My troublesome string";
        CString transitionString = stringToConvert;
        LPCTSTR myDesiredString = transitionString;
    
        wcout  << myDesiredString;
    }
    

提交回复
热议问题