rapidjson - change key to another value
问题 Here is the hello world of rapidjson. How can I change key "hello" to "goodbye" and get string from the json? I mean I want to parse json, change some keys and get json string back like {"goodbye" : "world"} . const char json[] = "{ \"hello\" : \"world\" }"; rapidjson::Document d; d.Parse<0>(json); 回答1: const char *json = R"({"hello": "world"})"; rapidjson::Document d; d.Parse<0> (json); rapidjson::Value::Member* hello = d.FindMember ("hello"); if (hello) { d.AddMember ("goodbye", hello-