You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
309 B

  1. #include <json.hpp>
  2. using json = nlohmann::json;
  3. int main()
  4. {
  5. // create a JSON array
  6. json j1 = {"one", "two", 3, 4.5, false};
  7. // create a copy
  8. json j2(j1);
  9. // serialize the JSON array
  10. std::cout << j1 << " = " << j2 << '\n';
  11. std::cout << std::boolalpha << (j1 == j2) << '\n';
  12. }