mirror of
https://github.com/nlohmann/json.git
synced 2024-08-25 14:27:02 +02:00
- updated documentation wrt. new repository layout - temporarily switched off Homebrew --HEAD building (can only be switched on after release) - set copyright date to 2018
17 lines
285 B
C++
17 lines
285 B
C++
#include <iostream>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
int main()
|
|
{
|
|
// create a JSON object
|
|
const json object =
|
|
{
|
|
{"one", 1}, {"two", 2}, {"three", 2.9}
|
|
};
|
|
|
|
// output element with key "two"
|
|
std::cout << object["two"] << '\n';
|
|
}
|