is there a function to do that in C++
thanks![]()
This is a discussion on int2string within the C++ Programming forums, part of the General Programming Boards category; is there a function to do that in C++ thanks...
is there a function to do that in C++
thanks![]()
In C++, you can use the string stream classes, like so:
You can also use the istringstream class to convert strings to numeric types.Code:int intval = 668; std::ostringstream stm; stm << val; std::string rslt = stm.str();
Both these classes are derived from a base class called ios_base. This is were you will find all the methods to set the format (preceision etc.) of your resulting strings.
thanks bros![]()