To work with json using a library jsoncpp. Previously created an array of objects can be cleared by clear
.
Json::Value value;
...
value.clear();
Also, it can be purified by arrayValue
(or nullValue
).
Json::Value value;
...
value = Json::arrayValue;
Question: What's the difference between clear
and arrayValue
?
Clear= Remove all object members and array elements.
nullvalue = Means a empty value.
null, empty array, and empty object are three different things in JsonCpp.
value.clear()
does the following:
value = Json:arrayValue
does the following:
So the two constructs are not semantically equivalent.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.