Not the way I know it Please tell me the easiest way to change the int type to string!
//1.
int a = 10;
char *intStr = itoa(a);
string str = string(intStr);
//2.
int a = 10;
stringstream ss;
ss << a;
string str = ss.str();
0 of the x c++ std :: stoi , :: to std string the ?
std::string s = std::to_string(42);
std::string s = std::to_stoi(42);
You can use it with .
© 2024 OneMinuteCode. All rights reserved.