There's nothing wrong with sprintf; it's perfectly valid C and C++ code. It has the further advantage - uncovered on a recent multi-platform project - of being considerably more stable than the STL equivalent stringstream classes, which insisted on producing different output on different machines while sprintf produced exactly the same, clearly documented output.
There's no reason not to use it, and in some cases you'll be better off. Just because something is shiny and new doesn't necessarily mean it's better, or that it even works.





Reply With Quote

Bookmarks