Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <nlohmann/json.hpp>
- using json = nlohmann::json;
- int
- main( int argc, char *argv[] )
- {
- json foo = R"({"key1": "value1"})"_json;
- std::cerr << "key1:" << foo["key1"] << ", size()=" << foo.size() << "\n";
- std::cerr << "key2:" << foo["key2"] << ", size()=" << foo.size() << "\n";
- }
- //
- /*
- $ g++ nloh.cpp
- $ ./a.out
- key1:"value1", size()=1
- key2:null, size()=2
- $
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement