Hi,
In the following function, I need to replace Percent with %. But when I do that, it is detected as a format specifier.
sprintf (buffer,"Volt,Volt,C,C,Percent")
How can I do this ?
Thanks,
Hi,
In the following function, I need to replace Percent with %. But when I do that, it is detected as a format specifier.
sprintf (buffer,"Volt,Volt,C,C,Percent")
How can I do this ?
Thanks,
Thanks !
That worked and looks easy once you know it.
Indeed the Conversion Specifier for % is % so you write %%
Note that if you have nothing to format, you don't need to use sprintf() (or better snprintf()) just use strcpy (or better strncpy() or strlcpy()) and you don't need to worry about the text.
strlcpy (buffer,"Volt,Volt,C,C,%", sizeof buffer);
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.