mirror of
https://github.com/nlohmann/json.git
synced 2024-08-22 04:52:35 +02:00
16 lines
273 B
C++
16 lines
273 B
C++
|
#include <json.hpp>
|
||
|
|
||
|
using namespace nlohmann;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
// create a string value
|
||
|
std::string s = "The quick brown fox jumps over the lazy dog.";
|
||
|
|
||
|
// create a JSON string value
|
||
|
json j = s;
|
||
|
|
||
|
// serialize the JSON string
|
||
|
std::cout << j << '\n';
|
||
|
}
|