mirror of
https://github.com/nlohmann/json.git
synced 2024-09-06 12:08:25 +02:00
16 lines
247 B
C++
16 lines
247 B
C++
|
#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';
|
||
|
}
|