user3797438
user3797438

Reputation: 485

How to concat LPWSTR in C code

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?

Upvotes: 0

Views: 972

Answers (2)

Chitresh Gupta
Chitresh Gupta

Reputation: 64

You can use wcscat. Visit this link:

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

Upvotes: 0

Eric
Eric

Reputation: 19863

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);

Upvotes: 1

Related Questions