2014-11-08 51 views
0

Concat的LPWSTR我有兩個變量,下面在我的C程序如何在C代碼

PWSTR linkName = L"fileName"; 
    PWSTR targetFile = L"pathName"; 

我想串像"mklink /j "+linkName+" "+targerFile即,我想連接上述兩個。

任何人都可以告訴我如何?

+0

++',你可以使用[此SO回答(http://stackoverflow.com/questions/15421139/concatenation-of-lpwstr-:訪問此鏈接字符串)。如果您可以選擇使用Win32 API,則可以使用[This SO answer](http://stackoverflow.com/questions/9440768/concatenating-a-string-using-win32-api)。 – 2014-11-08 07:08:45

回答

1

我認爲你要像wsprintf

分配爲您wchar_t的一個新的緩衝區,將保存結果

wsprintf(newBuf, "%s%s", linkName, targetFile);