convert a int to string c++

include

include

using namespace std;

int main() { int number = 123; // Initializing an integer variable string strNumber = to_string(number); // Converting integer to string using to_string function cout << "The integer converted to string is: " << strNumber << endl; // Output the converted string return 0; }