mirror of
https://github.com/nlohmann/json.git
synced 2024-08-24 22:07:02 +02:00
- updated documentation wrt. new repository layout - temporarily switched off Homebrew --HEAD building (can only be switched on after release) - set copyright date to 2018
19 lines
420 B
C++
19 lines
420 B
C++
#include <iostream>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
int main()
|
|
{
|
|
// create an array by creating copies of a JSON value
|
|
json value = "Hello";
|
|
json array_0 = json(0, value);
|
|
json array_1 = json(1, value);
|
|
json array_5 = json(5, value);
|
|
|
|
// serialize the JSON arrays
|
|
std::cout << array_0 << '\n';
|
|
std::cout << array_1 << '\n';
|
|
std::cout << array_5 << '\n';
|
|
}
|