mercredi 31 août 2016

How to iterate and get values from a json file shown using rapidjson

In the below code I have array of objects. I need to iterate over them and get their values.Please help.

Json File :

<pre>   
   [ 
   { 
      "condition":"Abdominal Distension",
      "meds":[  
         {  
            "genericName":"Bethanechol",
            "tradeNames":
            [  
               "Bethacol",
               "Betheran (25 mg)"
            ]
         },
         {  
            "genericName":"Pamabrom",
            "tradeNames":
            [  
               "Spasmonova (10mg/25mg/325mg)"
            ]
         }
      ]
   },
   {  
      "condition":"Alcohol abuse",
      "meds":[  
         {  
            "genericName":"Acamprosate",
            "tradeNames":
            [  
               "Acamprol tab",
               "Acamptass (333 mg)",
               "Acmacal tab"
            ]
         },
         {  
            "genericName":"Chlordiazepoxide",
            "tradeNames":
            [  
               "Anxizide",
               "Anxizide",
            ]
         }
      ]
   }
]
</pre>

Ignore Please : The post asks me to add something. But I don't know what to add.So. Again it says "It looks like your post is mostly code;Please add some more details." Oh God! I don't know what to add at all.Could You stop this please.

Aucun commentaire:

Enregistrer un commentaire