mirror of
https://github.com/nlohmann/json.git
synced 2024-12-03 21:59:08 +08:00
16 lines
275 B
C++
16 lines
275 B
C++
|
#include <json.hpp>
|
||
|
|
||
|
using namespace nlohmann;
|
||
|
|
||
|
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';
|
||
|
}
|