string typecasting in c++ code example
Example 1: convert int to string c++
int x = 5;
string str = to_string(x);
Example 2: convert int to string c++
int a = 10;
stringstream ss;
ss << a;
string str = ss.str();
int x = 5;
string str = to_string(x);
int a = 10;
stringstream ss;
ss << a;
string str = ss.str();