What is the easiest way to convert from int to equivalent string in C++. I am aware of two methods. Is there any easier way?
int
string
(1)
C++11 introduced std::to_string() for numeric types:
int n = 123; // Input, signed/unsigned short/int/long/long long/float/double std::string str = std::to_string(n); // Output, std::string