1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-06 06:42:33 +03:00

more documentation

This commit is contained in:
Niels
2015-06-21 22:42:32 +02:00
parent 770b9820fe
commit c85dbef98f
9 changed files with 441 additions and 85 deletions

View File

@ -0,0 +1,18 @@
#include <json.hpp>
using namespace nlohmann;
int main()
{
// create JSON values
json j_object = {{"one", 1}, {"two", 2}};
json j_array = {1, 2, 4, 8, 16};
// serialize without indentation
std::cout << j_object << "\n\n";
std::cout << j_array << "\n\n";
// serialize with indentation
std::cout << std::setw(4) << j_object << "\n\n";
std::cout << std::setw(2) << j_array << "\n\n";
}