json array parsing in c

前端 未结 3 513
深忆病人
深忆病人 2021-01-04 22:32

i am trying to parse a json array,i am facing problem.

My array is like this:

configure: {
  \"id\": 4,
  \"userId\": 107,
  \"deviceMacAddress\": \"         


        
3条回答
  •  臣服心动
    2021-01-04 22:52

    You can use the jsoncpp to do this job. Array as a Json::Value, you can

    medicationValue = jsonObject[medicationKey];
    Json::Value::Members member;
    member = medicationValue .getMemberNames();
    
    for (Json::Value::Members::iterator iter = member.begin(); iter != member.end(); iter++) {
        the element of medication here
    }
    

    I hope will help you.

提交回复
热议问题