Function cJSON_AddStringToObject

Synopsis

#include <cJSON.h>

cJSON * cJSON_AddStringToObject(cJSON *const object, const char *const name, const char *const string)

Description

No description yet.

Mentioned in

Source

Lines 2135-2145 in cJSON.c. Line 269 in cJSON.h.

CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
{
    cJSON *string_item = cJSON_CreateString(string);
    if (add_item_to_object(object, name, string_item, &global_hooks, false))
    {
        return string_item;
    }

    cJSON_Delete(string_item);
    return NULL;
}





Add Discussion as Guest

Log in