Imagine that I have this json:
{
"a":"b"
}
If I have a function in C++ that returns this json in string format, such as std::string getjson()
, it would return stringified version of this json like:
"{\"a\":\"b\"}"
To be complete:
std::string getjson()
{
return "{\"a\":\"b\"}";
}
myfavourite_jsonparser.parse(getjson());
This works.
Now imagine that the value of key in json contains a "
:
{
"a":"\"b"
}
How could I return this from std::string getjson()
function?