int to string type c++ code example Example: convert int to string c++ int x = 5; string str = to_string(x);