Could anyone tell me how to correctly assign a variable name to the return
of the function call in this example program. I needed to convert a integer
to a string, using stringstream. However after returning the string I am not
sure how to assign a variable name to it.
#include <iostream>
#include <sstream>
using namespace std;
string Convert(int);
void main ()
{
int num = 123456789;
"???" = Convert(num).c_str() //***variable here***
}
string Convert(int num)
{
stringstream test;
test << num;
return test.str();
}