Function cJSON_Parse

Synopsis

#include <cJSON.h>

cJSON * cJSON_Parse(const char *value)

Description

Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. Supply a block of JSON, and this returns a cJSON object you can interrogate.

Default options for cJSON_Parse

Mentioned in

Source

Lines 1171-1174 in cJSON.c. Line 148 in cJSON.h.

CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value)
{
    return cJSON_ParseWithOpts(value, 0, 0);
}





Add Discussion as Guest

Log in