json格式里的嵌套部分的数据应该怎么提取出来
比如这个 {"error_code":0,"error_msg":"SUCCESS","log_id":1012589256565,"timestamp":1632905469,"cached":0,"result":{"face_token":"879c7006f8af0c0d25b1da462c1","user_list":[{"group_id":"test01","user_id":"001","user_info":"","score":96.729072570801}]}}
我要提取这个"score" 里面的值怎么弄,下面是我写的,我只会提取没有嵌套的部分,嵌套的怎么提取出来
StaticJsonDocument<200> doc;
DeserializationError error = deserializeJson(doc, response);
if (error)
{
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.c_str());
}
const char* sensor = doc["error_msg"];
//float fs = doc["result"]["user_list"][0]["score"];
|