title: parse json arrays using cJSON library
body: <p>First off, this is a very broad question, and it might come across as me asking for the community to write my code for me. That is not my intent, but I am so lost, I don't know how to give enough information.</p>
  
  <p>I am attempting to use the cJSON library, written by Dave Gamble, 
   I found this is very useful to use for my embedded device for JSON parse and composing. </p>
  
  <p>to read in the following JSON array </p>
  
  <pre><code>{ 
   "name": "Jack", 
    "types":[23,56,78],
   "format": {
   "type": "rect",
    "width": 1920, } 
  }
  </code></pre>
  
  <p>.. and parsing the getting the object worked with this method </p>
  
  <pre><code>  cJSON *format = cJSON_GetObjectItem(json,"format");
  
    int framerate = cJSON_GetObjectItem(format,"width")-&gt;valueint; 
  </code></pre>
  
  <p>but I am not able to parse the key "name" and object simple key value ,</p>
  
  <p>I tried this </p>
  
  <pre><code>  cJSON *array = cJSON_GetArrayItem(json,"types"); 
  
    int value = cJSON_GetArrayItem(format1,1)-&gt;valueint;
  </code></pre>
  
  <p>but did not work, how to parse the array object and simple key value..</p>