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