If you are using
C++
, then the following code
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
ostringstream oss;
oss << "hello " << 12.5;
cout << oss.str() << endl;
}
should work out of the box, since
stringstream - C++ Reference[
^] is part of the
C++
standard library.
On the other hand, if you are using
C
(as the question is tagged) then you are out of luck.