Function cJSON_AddItemReferenceToArray

Synopsis

#include <cJSON.h>

cJSON_bool cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)

Description

Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON.

Mentioned in

Source

Lines 2055-2063 in cJSON.c. Line 229 in cJSON.h.

CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)
{
    if (array == NULL)
    {
        return false;
    }

    return add_item_to_array(array, create_reference(item, &global_hooks));
}





Add Discussion as Guest

Log in