Skip to content

Setting a value


Example on how to SET a value.

What does setting a value mean?

If that label / key already exists, overwrite it.
If not, create it.

C++:
Json json;
json.Parse(someJsonCode); // we have an already filled json


json["best_friend"] = "patrick";
// Whether or not a field called "best_friend" existed beforehand, 
// it exists now and contains the string "patrick".

That's it.