Convert int to string...

Why doesn't this work..I saw it online:
1
2
3
4
5
6
7
/***** Convert Int to String *****/
std::string convertInt(int number)
{
   stringstream ss;//create a stringstream
   ss << number;//add number to the stream
   return ss.str();//return a string with the contents of the stream
}


I have the stream header included.
Ah nevermind..needed the sstream header. Starting to learn how to read the docs better and online references. Works out rather nicely.
Topic archived. No new replies allowed.