What is the easiest way to convert from int to equivalent string in C++?
I am aware of possible methods. Is there any easier way to implement it?
(1)
int a = 10;
char *intStr = itoa(a);
string str = string(intStr);
(2)
int a = 10;
stringstream ss;
ss << a;
string str = ss.str();