mirror of
https://github.com/json-c/json-c.git
synced 2026-03-29 09:59:06 +08:00
* Make headers C++ compatible by change *this to *obj
* Add ifdef C++ extern "C" to headers
* Use simpler definition of min and max in bits.h
Larry Lansing, llansing at fuzzynerd dot com
* Remove automake 1.6 requirement
* Move autogen commands into autogen.sh. Update README
* Remove error pointer special case for Windows
* Change license from LGPL to MIT
Michael Clark <michael@metaparadigm.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@10 327403b1-1117-474d-bef2-5cb71233fd97
This commit is contained in:
3
test1.c
3
test1.c
@@ -8,6 +8,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
struct json_object *my_string, *my_int, *my_object, *my_array;
|
||||
struct json_object *new_obj;
|
||||
int i;
|
||||
|
||||
my_string = json_object_new_string("\t");
|
||||
printf("my_string=%s\n", json_object_get_string(my_string));
|
||||
@@ -28,7 +29,7 @@ int main(int argc, char **argv)
|
||||
json_object_array_add(my_array, json_object_new_int(3));
|
||||
json_object_array_put_idx(my_array, 4, json_object_new_int(5));
|
||||
printf("my_array=\n");
|
||||
for(int i=0; i < json_object_array_length(my_array); i++) {
|
||||
for(i=0; i < json_object_array_length(my_array); i++) {
|
||||
struct json_object *obj = json_object_array_get_idx(my_array, i);
|
||||
printf("\t[%d]=%s\n", i, json_object_to_json_string(obj));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user