I just wanted to mention, that the inbuild sprintf function changed behavior between V3.13 and V3.15.
Code: Select all
string s;
sprintf(s, "Test_%03s", "5");In V3.15 result is 'Test_ 5'
This is just for your info.
Code: Select all
string s;
sprintf(s, "Test_%03s", "5");Anyway, this is wrong for both of your versions.Your code produces "Test_ 5"
Code: Select all
#include
#include
int main()
{
char buffer[50];
char* x = "a";
sprintf(buffer, "Test_%03s", x);
printf("%s", buffer);
return 0;
}