Function cJSON_GetErrorPtr


#include <cJSON.h>

const char * cJSON_GetErrorPtr(void)


For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds.

Mentioned in


Lines 94-97 in cJSON.c. Line 176 in cJSON.h.

CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void)
    return (const char*) (global_error.json + global_error.position);

Add Discussion as Guest

Log in