mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-14 14:30:29 +01:00
21 lines
355 B
C++
21 lines
355 B
C++
|
#include <iostream>
|
||
|
#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 (const json::exception& e)
|
||
|
{
|
||
|
std::cout << e.what() << '\n';
|
||
|
}
|
||
|
}
|