2024-05-05 05:09 PM - edited 2024-05-06 05:42 AM
Hi i have this code:
char string[6]="Hello";
char string1[6]="World";
touchgfx::Unicode::UnicodeChar dst[6];
touchgfx::Unicode::UnicodeChar dst1[6];
touchgfx::Unicode::UnicodeChar txtAreaBuffer1[100];
Unicode::strncpy(dst, string, 6);
Unicode::strncpy(dst1, string1, 6);
Unicode::snprintf(txtAreaBuffer1, 100, "%s", dst, dst1);
Unicode::strncpy(txtAreaBuffer, txtAreaBuffer1, 100);
txtArea.invalidate();
Why i have output only Hello instead HelloWorld?
Solved! Go to Solution.
2024-05-05 05:33 PM
Unicode::snprintf(txtAreaBuffer1, 100, "%s %s", dst, dst1);
2024-05-05 05:33 PM
Unicode::snprintf(txtAreaBuffer1, 100, "%s %s", dst, dst1);
2024-05-05 05:33 PM
>>Why i have output only Hello instead HelloWorld?
You format a single string, but pass two parameters
Unicode::snprintf(txtAreaBuffer1, 100, "%s%s", dst, dst1);
2024-05-06 05:38 AM
Ofcourse, my mistake...