title: Key names in json-c
body: <p>I'm using json-c to parse the following JSON string:</p>
  
  <pre><code>{
    "root": {
      "a": "1",
      "b": "2",
      "c": "3"
    }
  }
  </code></pre>
  
  <p>And, I have the following C code. The above JSON is stored in the variable, b.</p>
  
  <pre><code>json_object *new_obj, *obj1, *obj2;
  int exists;
  
  new_obj = json_tokener_parse(b); 
  exists=json_object_object_get_ex(new_obj,"a",&amp;obj1); 
  if(exists==false) { 
    printf("key \"a\" not found in JSON"); 
    return; 
  } 
  exists=json_object_object_get_ex(new_obj,"b",&amp;obj2); 
  if(exists==false) { 
    printf("key \"b\" not found in JSON"); 
    return; 
  }
  </code></pre>
  
  <p>What is the correct key name to use for getting the value from key "a" using json_object_get_ex? </p>
  
  <p>What I have doesn't work (exists is false for both queries) for the JSON I have above, but it does work for the following JSON. I'm certain this has to do with a misunderstanding about which key to use for the "path" to key "a". </p>
  
  <pre><code>{      
     "a": "1",
     "b": "2",
     "c": "3"
  }
  </code></pre>