C++ conversion
How would you convert an int to string in C++? /******************************************************************************************************\ Edit: itoa worked but it made the numbers be in a char array, i wanted it to be a string, to fit my project(Getting a squared number, turning into a string to get the middle numbers then turning these middle numbers into an int and so on), if anyone came here to see the answer and have the same problem, use: #include <sstream> //We need this lib using namespace std; //So we dont use std:: int i = 12; //Any int value, can be double(I think) ostringstream buffer; //we need sstream for this buffer << i; //put the number in the var string numString= buffer.str(); //conversion happens here