json/doc/examples/operatorarray__key_type_const.cpp

16 lines
247 B
C++
Raw Normal View History

2015-06-25 00:40:16 +02:00
#include <json.hpp>
using namespace nlohmann;
int main()
{
// create a JSON object
json object =
{
{"one", 1}, {"two", 2}, {"three", 2.9}
};
// output element with key "two"
std::cout << object["two"] << '\n';
}