1
0
mirror of https://github.com/nlohmann/json synced 2024-12-28 11:21:07 +00:00
nlohmannjson/doc/examples/basic_json__object_t.cpp

16 lines
278 B
C++
Raw Normal View History

2015-06-20 22:59:33 +00:00
#include <json.hpp>
using json = nlohmann::json;
2015-06-20 22:59:33 +00:00
int main()
{
// create an object_t value
json::object_t value = { {"one", 1}, {"two", 2} };
// create a JSON object from the value
json j(value);
// serialize the JSON object
std::cout << j << '\n';
}