i have a STR16 (psString) that i want to add too.
something like this:
sprintf(psString,"%s 500 Left",psString);
but VS says STR16 is incompatible with sprintf
what’s a way i can modify this STR16 and end up a STR16 ?
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.
Use swprintf instead, since it deals with 16-bit wide characters rather than 8-bit characters. Windows provides a similar version called wsprintf. You can also use _stprintf and the preprocessor will convert it either 8 or 16 bit-wide characters based on the TCHAR definition.
Note that this function is considered unsafe. The wsprintf link above contains information on potential replacements, such as StringCbPrintfEx .