The C++ way would be to use a
std::stringstream object as:
std::stringstream fmt; fmt << a << " " << b << " > " << c;
The C way would be to use
The C way is difficult to get right since:
Of course, you may want to fall back on the C way if performance is an issue (imagine you are creating fixed-size million little
stringstream objects and then throwing them away).
~ Answered on 2012-05-02 08:19:53