I have tried wcscat() but i get a runtime access violation.
wchar_t* a = L"aaa";
wchar_t* b = L"bbb";
wchar_t* c;
c = wcscat(a, b);
Can somebody tell me what is wrong here? Or another way to solve my problem? Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
wcscatdoesn’t create a new string – it simply appendsbtoa. So, if you want to make sure you don’t cause a runtime access violation, you need to make sure there’s space forbat the end ofa. In the case above:You can still get a return value from the function, but it will simply return
a.