Skip to content

Read basic values from json


Example on how 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.AsJson.Get("name").AsString;
int age          = json.AsJson.Get("age").AsInt;
float height     = json.AsJson.Get("height").AsFloat;
bool isMale      = json.AsJson.Get("isMale").AsBool;

That's it.