00001 #include <json.hpp> 00002 00003 using json = nlohmann::json; 00004 00005 int main() 00006 { 00007 // create a JSON object 00008 const json object = 00009 { 00010 {"one", 1}, {"two", 2}, {"three", 2.9} 00011 }; 00012 00013 // output element with key "two" 00014 std::cout << object["two"] << '\n'; 00015 }