To_string is a function only available in C++11. This error is probably the reason why it was used in older versions of C++Solutions:
#include <string>
#include <sstream>
template <typename T>
std::string to_string(T value)
{
std::ostringstream os ;
os << value ;
return os.str() ;
}
int main()
{
std::string perfect = to_string(5) ;
}
Read More:
- C++ Primer Program in VsCode error: no match for call to ‘(std::__cxx11::string…)
- MOTR compiling error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_R
- [Solved] A-LOAM Ceres Compile Error: error: ‘integer_sequence’ is not a member of ‘std‘
- How to Solve “Status bar could not find cached time string image. Rendering in-process.” in Xcode
- How to Solve Fatal error stdatomic in C/C++ Compilation
- How to Solve brew ERROR in `initialize‘: Version value must be a string; got a NilClass ()
- [Solved] runtime error: reference binding to null pointer of type ‘std::vector<int, std::allocator<int>>‘
- How to Solve Error:‘itoa’ was not declared in this scope
- Windows: How to Solve PCL C2065 Error
- How to Solve Error: EOF occurred in violation of protocol (_ssl.c:877)
- [Solved] std::max() error C2589: ‘(‘ : illegal token on right side of ‘::‘
- Error 2 error c2491: XX: definition of dllimport static data member is not allowed
- C++ Error: terminating with uncaught exception of type std::out_of_range: vector Abort trap: 6
- How to Solve Error: “initializer element is not constant”
- [Solved] dhl: Error: LINQ to Entities does not support the specified type member “Date”
- How to Solve error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe‘ failed
- How to parse JSON string in.Net [error reading job object from jsonreader. Current jsonreader item is not an obj]
- How to Solve Error: Module did not self-register
- How to Solve VScode 2022 error: msvcp110d.dll not found
- How to Solve jQuery error: Uncaught ReferenceError: $ is not defined