Skip to content

Read basic values from json


Example on how to read basic values from a json.

We have this json:
{
    "name": "Parry Hotter",
    "age": 30,
    "height": 184.9,
    "isMale": false
}
C++:
Json json;
json.Parse(aboveJsonCode);

std::string name = json["name"];
int age          = json["age"];
float height     = json["height"];
bool isMale      = json["isMale"];

That's it.