Okay, so I have
tmp.cpp:
#include
int main()
{
std::to_string(0);
return 0;
}
But when I try to compile I g
to_string works with the latest C++ versions like version 11. For older versions you can try using this function
#include
#include
template
std::string ToString(T val)
{
std::stringstream stream;
stream << val;
return stream.str();
}
By adding a template you can use any data type too.
You have to include #include
here.