#include <iostream> int test =9; std::stringstream sid; sid << test; std::string test_str = sid.str();