1 #include <iostream> 2 #include <nlohmann/json.hpp> 3 4 using json = nlohmann::json; 5 main()6int main() 7 { 8 json j; 9 j["address"]["street"] = "Fake Street"; 10 j["address"]["housenumber"] = "12"; 11 12 try 13 { 14 int housenumber = j["address"]["housenumber"]; 15 } 16 catch (json::exception& e) 17 { 18 std::cout << e.what() << '\n'; 19 } 20 } 21