Answer the question
In order to leave comments, you need to log in
How to parse json from a string (boost)?
I have a perfectly working example of parsing a json file, but the question is, how can I parse a json string without loading it from a file, but, let's say, taking it from std::string?
std::ifstream ifs("config.json");
boost::property_tree::ptree pt;
boost::property_tree::read_json(ifs, pt);
string s( pt.get<string>("responseData.id") );
cout << s << endl;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question