Hi there,
what is the best way to convert uint16_t variable into std::string? Could you please show this with a code example? Thank you!
This is a discussion on Convert uint16_t to std::string? within the C++ Programming forums, part of the General Programming Boards category; Hi there, what is the best way to convert uint16_t variable into std::string? Could you please show this with a ...
Hi there,
what is the best way to convert uint16_t variable into std::string? Could you please show this with a code example? Thank you!
Use << to "print" the integer into a stringstream. Stringstreams convert to strings using the .str() function.
worked great, thanks!
Another way:
boost::lexical_cast<std::string>(my_integer);
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^