Hopefully this thread will become the place to ask such questions.
and I've got two to start off with.
In C++, is there a standard way to format a string (printf style) but instead of printing it to console, have it return a string or char array?
Something like the fictional "format" function here.
- Code: Select all
int number = 5;
std::string coolText = format("the magic number is %i!!", number);
coolText would hold "the magic number is 5!!"
My other question is what does it mean when a struct is initialized with {0};? I sometimes see code like...
- Code: Select all
CoolStruct myCoolStruct = {0};