Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Source from: http://sourceforge.net/projects/cajun-jsonapi/
- std::stringstream jsonString("{ \"name\": \"gerjo\", \"age\": 24 } ");
- // Storage container for the to-be-read data:
- json::Object data;
- // Read the jsonString into the storage container:
- json::Reader::Read(data, jsonString);
- // Retrieve the values.
- int age = (json::Number) data["age"];
- std::string name = (json::String) data["name"];
- std::cout << "Name is: " << name << " age is: " << age << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment