json/doc/examples/basic_json__string_t.cpp

16 lines
296 B
C++
Raw Normal View History

2015-06-22 04:42:32 +08:00
#include <json.hpp>
using json = nlohmann::json;
2015-06-22 04:42:32 +08:00
int main()
{
// create an string_t value
json::string_t value = "The quick brown fox jumps over the lazy doc";
// create a JSON string from the value
json j(value);
// serialize the JSON array
std::cout << j << '\n';
}