Skip to content

Instantly share code, notes, and snippets.

@v6ak
Created October 18, 2014 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v6ak/a3ee8d5759e964f3fec1 to your computer and use it in GitHub Desktop.
Save v6ak/a3ee8d5759e964f3fec1 to your computer and use it in GitHub Desktop.
#include <iostream>
#include "json.h"
using namespace std;
int main() {
Json::Number num(3.14159265358972);
Json::String s("5.\" ' \1 0");
Json::Boolean t(true);
Json::Boolean f(false);
Json::Array a = {{&s, &t, &f, &num}};
Json::Object o = {{{"num", &num}, {"t", &t}, {"a", &a}}};
cout << num << endl << s << endl << endl;
cout << Json::null << " " << t << " " << f << endl;
cout << "a: " << a << endl;
cout << "o: " << o << endl;
return 0;
}
3.14159
"5.\" ' \u0x7fff064b1828 0"
null true false
a: [
"5.\" ' \u0x7fff064b17a8 0",
true,
false,
3.14159
]
o: {
"a":[
"5.\" ' \u0x7fff064b1708 0",
true,
false,
3.14159
],
"num":3.14159,
"t":true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment