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)
I use:
int myint = 0; long double myLD = 0.0; string myint_str = static_cast(&(ostringstream() << myint))->str(); string myLD_str = static_cast(&(ostringstream() << myLD))->str();
It works on my Windows and Linux g++ compilers.