Function cJSON_AddNumberToObject

Synopsis

#include <cJSON.h>

cJSON * cJSON_AddNumberToObject(cJSON *const object, const char *const name, const double number)

Description

No description yet.

Mentioned in

Source

Lines 2123-2133 in cJSON.c. Line 268 in cJSON.h.

CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number)
{
    cJSON *number_item = cJSON_CreateNumber(number);
    if (add_item_to_object(object, name, number_item, &global_hooks, false))
    {
        return number_item;
    }

    cJSON_Delete(number_item);
    return NULL;
}





Add Discussion as Guest

Log in