New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Check the following code :
https://code.sololearn.com/c7TAtT1Q07jv/#cpp
0
Lone Wolf 7 , there's a method in <string> header called std::to_string(), it takes in an integer value and converts it to a string;
Eg: std::string str=std::to_string(1000);
Another way is to use 'static_cast'
Eg: std::string str=static_cast<std::string>(100);