Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Not sure, but I think may be the fifth(last part of string) %d holds the 'end of the string character (or so called null termination) "\0"'.
I tested it. The code works with or without the very last %d. It was probably placed there by mistake.
I've never even heard of snprintf
But I must admit that the solution is pretty to read.
Though I must ask about the fifth "%d" in the last part of the string. Why is that there?
I was pleasantly surprised to see that the solution I thought would be considered an inefficient "naive" approach seems to be a pretty popular one, since I seem to be unfamiliar with advanced string manipulation/creation in C++.
Mine is pretty much the same, just with some minor formatting differences