1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-06 06:42:33 +03:00

📝 update documentation

This commit is contained in:
Niels Lohmann
2021-01-21 21:47:19 +01:00
parent 51ac6000d2
commit d00ad33e46
9 changed files with 96 additions and 1 deletions

View File

@ -0,0 +1,22 @@
#include <iostream>
# define JSON_DIAGNOSTICS 1
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
json j;
j["address"]["street"] = "Fake Street";
j["address"]["housenumber"] = "12";
try
{
int housenumber = j["address"]["housenumber"];
}
catch (json::exception& e)
{
std::cout << e.what() << '\n';
}
}