A function to convert an int to a string:

#include <string>
#include <sstream>
std::string convertIntToString (int theInt) {
 std::stringstream out;
 out << theInt;
 std::string theString = out.str();
 return theString;
}

Thanks to this post by Rares at Not So Frequently Asked Questions.