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.

15 lines
277 B

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