#include<iostream>
#include<string>
#include <sstream>
usingnamespace std;
int main(void)
{
int i = 12345;// the integer
stringstream ss;
string istr;// the string
ss << i;// stream integer into stringstream object
ss >> istr;// stream back into string
cout << istr;// test output
cout << endl;
return 0;
}
This works but I'm not sure it's the simplest possible way.
EDIT: horance89 has a better idea. I forgot about itoa(). Athars solution may be simplest of all but I haven't used boost yet.