When I use
str is a string with size() of 6458, but msg has size() of 1023. What's going on here in strfmt?Code:string msg = strfmt("%s\n", str.c_str());
Printable View
When I use
str is a string with size() of 6458, but msg has size() of 1023. What's going on here in strfmt?Code:string msg = strfmt("%s\n", str.c_str());
strfmt() appears to be non-standard, so you would need to refer to the relevant docs.
Why not use the standard "sprintf" function? Ok, so you have to muck about a bit more to do that, but it should work. Or use the stringstream class to format a string. Both of these solutions should solve the problem.
And funnily enough, the first few references to strfmt() that I could find was this question, so I guess it's a pretty unusual function.
--
Mats