This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf conversion problems

Why does sprintf generate a Null when sprinting extended character 253(decimal) in to a a string variable?

i.e.


sprintf(s,"%s","ý");


If I then look at s in debug the first location is NULL.

All other extended characters appear fine!

Parents

  • Interesting. For me,

    sprintf (buf, "%s", "375");

    works as expected, as do

    sprintf (buf, "%s", "\375");
    sprintf (buf, "%s", "\xFD");

    How do you input this character into your string literal? Is it some sort of Unicode (or other "wide" character) value that has a leading null as part of the 16 bits?

Reply

  • Interesting. For me,

    sprintf (buf, "%s", "375");

    works as expected, as do

    sprintf (buf, "%s", "\375");
    sprintf (buf, "%s", "\xFD");

    How do you input this character into your string literal? Is it some sort of Unicode (or other "wide" character) value that has a leading null as part of the 16 bits?

Children
No data