Json::Value obj; obj["key1"] = "value1"; obj["key2"] = "value2"; obj.clear(); // removes all values from the object
Json::Value arr(Json::arrayValue); arr.append("value1"); arr.append("value2"); arr.clear(); // removes all values from the arrayPackage Library: cpp json is a popular library used to parse and manipulate JSON data in C++. It is available as a header-only library and can be included directly in your code.