mirror of
https://github.com/nlohmann/json.git
synced 2024-08-25 22:37:01 +02:00
16 lines
256 B
C++
16 lines
256 B
C++
#include <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';
|
|
}
|