mirror of
https://github.com/nlohmann/json.git
synced 2024-12-15 14:39:02 +08:00
16 lines
277 B
C++
16 lines
277 B
C++
#include <json.hpp>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
int main()
|
|
{
|
|
// create an array_t value
|
|
json::array_t value = {"one", "two", 3, 4.5, false};
|
|
|
|
// create a JSON array from the value
|
|
json j(value);
|
|
|
|
// serialize the JSON array
|
|
std::cout << j << '\n';
|
|
}
|