2014-11-08 52 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);