永发信息网

json 数据解析

答案:1  悬赏:20  手机版
解决时间 2021-02-06 03:15
  • 提问者网友:趣果有间
  • 2021-02-05 13:02
{"result":[{"tel":"15053279793","cust_name":"金晓城商店","cust_id":"1037020503359","crt_date":"20141124","total_num":"38","total_qty":"38","eff_days":"1"},{"tel":"85880799","cust_name":"青岛飞天五星酒业有限公司","cust_id":"1037020503436","crt_date":"20141124","total_num":"1","total_qty":"7","eff_days":"1"},{"tel":"13583229107","cust_name":"崂山区极地东海岸烟酒茶行","cust_id":"1037020502509","crt_date":"20141124","total_num":"12","total_qty":"43","eff_days":"1"}],"code":"00","msg":"请求成功"} 求出total_num
遍历出来每一个数组里边的total_num
最佳答案
  • 五星知识达人网友:逐風
  • 2021-02-05 14:26
你还需要json的API C++有开源的lib

Json::Value protocolInfo;
Json::Reader readJson;
bool result = readJson.parse((char*)pTemAInfo,protocolInfo);

Json::Value protocolInfoValue = protocolInfo["result"];

int i = 0;
while(1)
{
Json::Value temName = protocolInfoValue[i][total_num];

CString strName = temName.asCString();

i++;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯