
Basic wchar_t concatenation problem
- or -
Post a project like this220
$20
- Posted:
- Proposals: 9
- Remote
- #4379298
- Awarded
Expert : PHP|Wordpress|Symfony|Laravel|Cross Platform Mobile App|Flutter|Dart|React|Node.js|Next.js|Real Estate IDX|RETS|RESO|MLS|API Integration/Development
12292357113144125158265099903107320123155742626811222389312306000
Description
Experience Level: Entry
am using ms vc++ - i need as simple program to concatenate 3 wchar_t* variables into
one inside a loop. problem description is attached. it is also listed below:
I am having a problem with wchar_t* variables. If I create an initial wchar_t* by using something like:
wchar_t* InitValue = L”SM_Lst_”;
my expectation is that InitValue will have a length of 16:
• 2 bytes for each of the y characters in the string and 2 chars for the null terminator.
• sizeof(L"SM_Lst_"), in fact, returns 16
I need to construct a loop. In pseudo code it is
Int CharCount;
wchar_t* AddString = L””;
wchar_t* Name = L””;
I = 0;
while(i < 3){
AddString = I formatted as “%03d”
Name = InitString + AddString + “_n”;
CharCount = SomeFunc(Name); // which will return 26 for each iteration
i ++;
}
Here are the requirements:
1. Name will have a value of L”SM_Lst_000_n”, L”SM_Lst_001_n” and L”SM_Lst_002_n”
for each of the iterations, respectively
2. SomeFunc (e.g. wcslen, sizeof etc…) will return a CharCount value of 26
3. The app must be work in VS2022 as a Dialog based app
No need to develop the app – ie I will accept code but the code hast to work. There are an awful lot of examples on the internet that simply do not work
one inside a loop. problem description is attached. it is also listed below:
I am having a problem with wchar_t* variables. If I create an initial wchar_t* by using something like:
wchar_t* InitValue = L”SM_Lst_”;
my expectation is that InitValue will have a length of 16:
• 2 bytes for each of the y characters in the string and 2 chars for the null terminator.
• sizeof(L"SM_Lst_"), in fact, returns 16
I need to construct a loop. In pseudo code it is
Int CharCount;
wchar_t* AddString = L””;
wchar_t* Name = L””;
I = 0;
while(i < 3){
AddString = I formatted as “%03d”
Name = InitString + AddString + “_n”;
CharCount = SomeFunc(Name); // which will return 26 for each iteration
i ++;
}
Here are the requirements:
1. Name will have a value of L”SM_Lst_000_n”, L”SM_Lst_001_n” and L”SM_Lst_002_n”
for each of the iterations, respectively
2. SomeFunc (e.g. wcslen, sizeof etc…) will return a CharCount value of 26
3. The app must be work in VS2022 as a Dialog based app
No need to develop the app – ie I will accept code but the code hast to work. There are an awful lot of examples on the internet that simply do not work
Jim E.
100% (30)Projects Completed
16
Freelancers worked with
11
Projects awarded
49%
Last project
5 Oct 2025
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-

Name: SM_Lst_000_n, wcslen: 13, sizeof: 26
Name: SM_Lst_001_n, wcslen: 13, sizeof: 26
Name: SM_Lst_002_n, wcslen: 13, sizeof: 26
Is what you are looking for? Please let me know. I will provide you full code and you can test it.
Thanks
Naresh
1131205
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies