I am writing a server-client program. The server is written in C++ and I use JSON strings to send the data. This library helps me a lot and everything works, but I have one question: How can I parse a JSON array of strings to a normal C++ array? I searched for methods in the documentation, but didn't find any. Do I have to write my own function?
Example, where s is the JSON string {"msg":"message", "content":["content1", "content2"]}:
CJsonObject *obj = CJsonParser::Execute(s);
string msg = (*obj)["msg"]->ToString();
string content = (*obj)["content"]->ToString();
cout << msg << endl; // message
cout << content << endl; // ["content1", "content2"]
But I want an array/vector of "content1", "content2".