0

I have two variables as below In my C program

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

I want string like "mklink /j "+linkName+" "+targerFile i.e., I want to concatenate the above two.

Can any one tell me how?

user3797438
  • 405
  • 3
  • 6
  • 24
  • If you have the option of using `C++`, you can use [this SO answer](http://stackoverflow.com/questions/15421139/concatenation-of-lpwstr-strings). If you have the option of using Win32 API, you can use [this SO answer](http://stackoverflow.com/questions/9440768/concatenating-a-string-using-win32-api). – R Sahu Nov 08 '14 at 07:08

2 Answers2

1

I think that you want something like wsprintf

Allocate a new buffer for your wchar_t which will hold the result

wsprintf(newBuf, "%s%s", linkName, targetFile);
Eric
  • 19,525
  • 19
  • 84
  • 147
0

You can use wcscat. Visit this link:

http://msdn.microsoft.com/en-us/library/h1x0y282.aspx