Вот мой кодовый фрагмент: < /p>
#include
using json = nlohmann::json;
chat_message m; // helpter class to send the message
json j;
j["name"] = "States";
j["type "]= "Regular";
j["num"] = 4;
m.body_length( j.asString().size() ); // throws error on j.asString
< /code>
Я хочу изменить весь этот объект json j < /code> на std :: string < /code> и отправить его на сервер. < /p>
Как преобразовать этот объект в std :: string < /code>? Я новичок в этом json.
Подробнее здесь: https://stackoverflow.com/questions/609 ... nto-string