a few more README changes

This commit is contained in:
Kevin Branigan 2011-08-22 00:55:11 -04:00
parent b051ed05d7
commit 65de016c38
1 changed files with 26 additions and 24 deletions

View File

@ -185,7 +185,8 @@ You'd use:
void parse_object(cJSON *item)
{
int i; for (i=0;i<cJSON_GetArraySize(item);i++)
int i;
for (i = 0 ; i < cJSON_GetArraySize(item) ; i++)
{
cJSON * subitem = cJSON_GetArrayItem(item, i);
// handle subitem.
@ -221,7 +222,8 @@ For instance, suppose you wanted to build an array of objects?
cJSON * Create_array_of_anything(cJSON ** items, int num)
{
int i;cJSON *prev, *root=cJSON_CreateArray();
int i;
cJSON * prev, * root = cJSON_CreateArray();
for (i = 0 ; i < 24 ; i++)
{
if (!i) root->child = objects[i];