mirror of
https://github.com/nlohmann/json
synced 2024-11-15 16:50:06 +00:00
16 lines
278 B
C++
16 lines
278 B
C++
#include <json.hpp>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
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';
|
|
}
|