Hi there
I'm using Microsoft Cpp REST SDK v1.2 with Visual Studio 2010.
My goal is to read json from web api.
Which is the best way to convert utility::string_t and to_string() to std::string
My code is the following
I'm using Microsoft Cpp REST SDK v1.2 with Visual Studio 2010.
My goal is to read json from web api.
Which is the best way to convert utility::string_t and to_string() to std::string
My code is the following
for(auto iter = obj.cbegin(); iter != obj.cend(); ++iter)
{
// Make sure to get the value as const reference otherwise you will end up copying
// the whole JSON value recursively which can be expensive if it is a nested object.
const json::value &str = iter->first;
const json::value &v = iter->second;
std::wcout << L"String: " << str.as_string() << L", Value: " << v.to_string() << std::endl;
}