I have a JSON string like this:
{"callCommand":{"command":"car","floor":"2","landing":"front"}}
Now, I would like to check if there is a name called command
and get the value. Is it possible? My code is as follow, but it doesn't work.
const char json[] = "{\"callCommand\":{\"command\":\"car\",\"floor\":\"2\",\"landing\":\"front\"}}";
rapidjson::Value::ConstMemberIterator itr = d.FindMember("command");
if (itr != d.MemberEnd())
printf("command = %s\n", d["callCommand"]["command"].GetString());