This is what i did to create array
fpJson = fopen("nMap.txt","w");
json_t *array = json_array();
 for(i=0;i<9;i++)
 {
   sprintf(index,"PID%d",i+1);
   if(strcmp(topo[i].ipAddress,"")!=0)
   {
        json =json_pack("{s : {s: [s], s: [s]}, }",
               index,
                   "mac", topo[i].macAddress,
                   "ipv4", topo[i].ipAddress
              );
   }
   else
   {
       json =json_pack("{s : {s: [s]}, }",
               index,
                   "mac", topo[i].macAddress
     );
   }
   json_array_append(array,json);
 }
 printf("json array size %d : \n",json_array_size(array));   // prints correct size of 9
//>> Now I want array to be packed
 char *str = "{s: {}, s: {s: s, s: o}}";
 jSon =json_pack(
       str,
       "meta",
       "data",
           "map-vtag", "123456",
           "map",
            json_array_get(array,0),
         );
 json_dumpf(jSon, fpJson,1);
 json_decref(jSon);
I am only able to get single only element from array packed, but not the whole array. how should I do it ?Regards
Deepankar
--
rogerz