Files
json/examples/basic_json__copyassignment.cpp
T
2026-10-26 21:24:35 +00:00

19 lines
276 B
C++

#include <iostream>
#include <nlohmann/json.hpp>
using nlohmann::json;
int main()
{
// create JSON values
json a = 23;
json b = 42;
// copy-assign a to b
b = a;
// serialize the JSON arrays
std::cout << a << '\n';
std::cout << b << '\n';
}